-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 rounding in steps easing function #17743
Conversation
cc @RobWalt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
I think it would be good to support all of the CSS modi of steps via configuration options somewhere. Can you open an issue and link to this PR please? I'll tackle it later on when I'm back home (on mobile atm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you take a screenshot of what it looks like with your changes?
It does look odd on close inspection. It starts like halfway through a step I think. And then I swear the vertical lines are slightly bent. Maybe I’m seeing things tho
That's the appearance, but I would say "it advances half-way through the step."
That's to be expected based on the sampling that's happening in the example.
Sure |
Looking into the failing test. It succeeds locally. edit: Oh, oops. Just failed to push the new test code. |
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
Objective
While working on #17742, I noticed that the
Steps
easing function looked a bit suspicious.Comparing to the options available in css:
It is "off the charts," so probably not what users are expecting.
Solution
Use
floor
when rounding to match the default behavior (jump-end, top right) in css.Testing
I had to modify an existing test that was testing against the old behavior. This function and test were introduced in #14788 and I didn't see any discussion about the rounding there.
cargo run --example easing_functions
Migration Guide
EaseFunction::Steps
now behaves like css's default, "jump-end." If you were relying on the old behavior, we plan on providing it. See #17744.