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

Floating point values entered in inspector rounded to 3 decimal places #75150

Closed
matthewmartin295 opened this issue Mar 20, 2023 · 4 comments
Closed

Comments

@matthewmartin295
Copy link

Godot version

v4.0.stable.official [92bee43]

System information

Linux Mint

Issue description

Entering a float value in the editor forcibly rounds the input to 3 decimal places. I see issue #18251 was opened in 2018 on v3.0.2, and pull #25470 which was closed in favor of pull #30776 which has a related commit (it looks to me like this fix was for the slider functionality), but the issue remains.

When I mouse over a float value in the editor the tool tip shows the full precision. If I try to enter a value in the editor, it is truncated to 3 decimals. The editor allows you to enter a float of any length.

For example, if you enter an approximation of sqrt(2) into a transform position: "1.414213562" the editor will save the value (and display it back to you in the tool tip) as 1.41400000000431. This is the closest float32 approximation of 1.414, not the closest float32 approximation of 1.414213562.

This is an issue for float32s as part of vectors, but also stand-alone float64s.

Steps to reproduce

  1. Open any Godot project.
  2. Add any node with a transform.
  3. Enter any float with more than 3 digits of precision into one of the position transform fields.
  4. See that the float value stored in the field is rounded to 3 decimal places before being cast as a float.

Minimal reproduction project

N/A

@matthewmartin295
Copy link
Author

matthewmartin295 commented Mar 20, 2023 via email

@Calinou
Copy link
Member

Calinou commented Mar 20, 2023

Which property did you try entering the value in? Check its property hint in the source code to see the rounding step it applies (min,max,step). If none is specified, the Default Float Step editor setting is used.

I see issue #18251 was opened in 2018 [...] but the issue remains.

Please comment in the original issue instead of creating a new issue in this case.

@matthewmartin295
Copy link
Author

I am trying to edit a transform position. So the float is part of a vector3. Changing Default Float Step in editor settings has no effect, so there must be a valid property hint.

godotengine/godot-proposals#3524 looks exactly right and covers the use case for my issue.

Thanks for linking that, I hadn't found it before - it's clear that this is part of a larger discussion and not a simple fix. Feel free to close this ticket in favor of others with more context.

@Calinou
Copy link
Member

Calinou commented Mar 20, 2023

I am trying to edit a transform position. So the float is part of a vector3. Changing Default Float Step in editor settings has no effect, so there must be a valid property hint.

Default Float Step only affects float properties, not vector/transform properties.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants