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

"Cannot get ratio when minimum and maximum value are equal" error at run time #33907

Closed
georgikoemdzhiev opened this issue Nov 26, 2019 · 4 comments · Fixed by #33908
Closed

Comments

@georgikoemdzhiev
Copy link
Contributor

Godot version:
3.2 Beta 2 Mono
OS/device including version:
Manjaro/XPS 15 9560
Issue description:
When I run the project it throws the following error:

Godot_v3.2-beta2_mono_x11_64]$ Mono: Logfile is: /home/user/mono_logs/2019_11_25 19.51.24 (6867).txt
ERROR: get_as_ratio: Cannot get ratio when minimum and maximum value are equal.
   At: scene/gui/range.cpp:176.

Steps to reproduce:

  1. Create a (mono) Project
  2. Create a scene with Node2D root and add an icon (drag the Godot logo into the scene)
  3. Attach a C# Script to the Node2D
  4. Save; Build and run the project

Minimal reproduction project:
project.zip

@akien-mga
Copy link
Member

I've seen that too in the current master branch (5ddce7a) on classical builds.

@akien-mga
Copy link
Member

The error is raised due to the changes in #33583, so it indicates that something in the editor uses min == max for Range.

@akien-mga akien-mga self-assigned this Nov 26, 2019
akien-mga added a commit to akien-mga/godot that referenced this issue Nov 26, 2019
It will now raise an error whenever this happens so that we can fix
these situations. `max == min` is not allowed as it could lead to
divisions by zero in ratios, and `max < min` doesn't make much sense.

Fixes godotengine#33907.
@me2beats
Copy link

still get the error
3.2.3 Windows
reproduce: set min and max to 0

@akien-mga
Copy link
Member

Please open a dedicated issue with a reproduction project, this variant of the error was fixed a year ago.

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.

3 participants