Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some editor fields don't accept comma as a decimal separator #80664

Closed
aXu-AP opened this issue Aug 15, 2023 · 2 comments · Fixed by #80699
Closed

Some editor fields don't accept comma as a decimal separator #80664

aXu-AP opened this issue Aug 15, 2023 · 2 comments · Fixed by #80699

Comments

@aXu-AP
Copy link
Contributor

aXu-AP commented Aug 15, 2023

Godot version

v4.1.1.stable.official [bd6af8e]

System information

Windows 10

Issue description

Most numerical fields in editor like inspector properties and settings accept comma as input (eg. 5,5 gets parsed to 5.5). However, there's some inconsistency in this support. Color picker doesn't support this and also Input Map's deadzone fields.
comma

Steps to reproduce

Open any color picker in inspector or Input Map settings, try to input value like 0,5 in it.

Minimal reproduction project

Any project

@Calinou
Copy link
Member

Calinou commented Aug 15, 2023

Accepting commas as decimal separator was special-cased in EditorSpinSlider, but not SpinBox: #42376
This is because valid Expressions may contain commas, such as pow(2, 16) = 65536. We could also break support for those expressions in SpinBox to make commas work as a decimal separator there – I'm not sure how many people rely on expressions with commas in SpinBox in practice.

Like ColorPicker, the input map editor's deadzones also use bare SpinBoxes, not EditorSpinSliders.

If we want to do a more elaborate workaround, we could replace , with . only if the expression doesn't contain any parentheses. This way, you can still use pow() and comma separators will keep working in simple math operations.

@aXu-AP
Copy link
Contributor Author

aXu-AP commented Aug 15, 2023

Nice to hear that there's some reasoning behind this. Your suggestion sounds like win-win. Using keyboard layout (finnish here) where numpad has comma, not period, I always end up filling these field twice - first with comma, only then notice the mistake. I'm infinitely grateful that inspector parses commas also 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants