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

Add ways to configure EasingFunction::Steps via new StepConfig #17752

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

RobWalt
Copy link
Contributor

@RobWalt RobWalt commented Feb 9, 2025

Objective

  • In Fix rounding in steps easing function #17743, attention was raised to the fact that we supported an unusual kind of step easing function. The author of the fix kindly provided some links to standards used in CSS. It would be desirable to support generally agreed upon standards so this PR here tries to implement an extra configuration option of the step easing function
  • Resolve Support more "step" easing modes #17744

Solution

  • Introduce StepConfig
  • StepConfig can configure both the number of steps and the jumping behavior of the function
  • StepConfig replaces the raw usize parameter of the EasingFunction::Steps(usize) construct.
  • StepConfigs default jumping behavior is end, so in that way it follows Fix rounding in steps easing function #17743

Testing

Migration Guide

  • EasingFunction::Steps now uses a StepConfig instead of a raw usize. You can replicate the previous behavior by replaceing EasingFunction::Steps(10) with EasingFunction::Steps(StepConfig::new(10)).

@RobWalt RobWalt changed the title Feat/step curve config Add ways to configure EasingFunction::Steps via new StepConfig Feb 9, 2025
I modified them slightly so it should fall under fair use!
@RobWalt RobWalt marked this pull request as ready for review February 9, 2025 07:19
@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Animation Make things move and change over time A-Math Fundamental domain-agnostic mathematical operations D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Animation Make things move and change over time A-Math Fundamental domain-agnostic mathematical operations C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support more "step" easing modes
2 participants