bevy/crates/bevy_math/images/easefunction
RobWalt aa8793f6b4
Add ways to configure EasingFunction::Steps via new StepConfig (#17752)
# Objective

- In #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 #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.
- `StepConfig`s default jumping behavior is `end`, so in that way it
follows #17743

## Testing

- I added a new test per `JumpAt` jumping behavior. These tests
replicate the visuals that can be found at
https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function/steps#description

## 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))`.

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-02-11 22:19:01 +00:00
..
BackIn.svg
BackInOut.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
BackOut.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
BothSteps.svg Add ways to configure EasingFunction::Steps via new StepConfig (#17752) 2025-02-11 22:19:01 +00:00
BounceIn.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
BounceInOut.svg
BounceOut.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
CircularIn.svg
CircularInOut.svg
CircularOut.svg
CubicIn.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
CubicInOut.svg
CubicOut.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
Elastic.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
ElasticIn.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
ElasticInOut.svg
ElasticOut.svg
EndSteps.svg Add ways to configure EasingFunction::Steps via new StepConfig (#17752) 2025-02-11 22:19:01 +00:00
ExponentialIn.svg
ExponentialInOut.svg
ExponentialOut.svg
Linear.svg
NoneSteps.svg Add ways to configure EasingFunction::Steps via new StepConfig (#17752) 2025-02-11 22:19:01 +00:00
QuadraticIn.svg
QuadraticInOut.svg
QuadraticOut.svg
QuarticIn.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
QuarticInOut.svg
QuarticOut.svg
QuinticIn.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
QuinticInOut.svg
QuinticOut.svg
README.md EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
SineIn.svg
SineInOut.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
SineOut.svg EaseFunction svg graphs in doc (#17461) 2025-02-08 09:52:39 +00:00
SmootherStep.svg
SmootherStepIn.svg
SmootherStepOut.svg
SmoothStep.svg
SmoothStepIn.svg
SmoothStepOut.svg
StartSteps.svg

EaseFunction

These graphs are auto-generated via tools/build-easefunction-graphs.