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

Fix Range property dependencies #53602

Merged
merged 1 commit into from
Nov 18, 2021
Merged

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Oct 9, 2021

Fixes #46778
Fixes #46863
Alternative to #47017

After setting min, max or page, a validation is called that ensures min < max and page < max - min, with min having the highest importance (i.e. max and page are adjusted to min). The linked properties ensure that you can properly undo the changes.

I tried many combinations and undo works properly in all cases, but I might've missed something. Testing appreciated.

Can't be cherry-picked unless the core part of #51583 is backported. #47017 is better for 3.x, assuming it works correctly.

@KoBeWi KoBeWi added this to the 4.0 milestone Oct 9, 2021
@KoBeWi KoBeWi requested a review from a team as a code owner October 9, 2021 15:41
@PtiLuky
Copy link

PtiLuky commented Oct 11, 2021

I think set_min and set_max are not consistent:

  • set_max will change max value if out of correct range,
  • set_page will change page value if out of correct range
  • set_min will change max value if min is out of range...

@KoBeWi
Copy link
Member Author

KoBeWi commented Oct 11, 2021

This is intended, we can't have properties depend on each other mutually. One of them needs to be prioritised.
(although I didn't test if it would really be a problem)

@akien-mga akien-mga merged commit bae15cb into godotengine:master Nov 18, 2021
@akien-mga
Copy link
Member

Thanks!

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