diff --git a/crates/bevy_math/src/curve/easing.rs b/crates/bevy_math/src/curve/easing.rs index 5fac9838d76f9..a5e5692e6f48f 100644 --- a/crates/bevy_math/src/curve/easing.rs +++ b/crates/bevy_math/src/curve/easing.rs @@ -685,7 +685,7 @@ mod easing_functions { #[inline] pub(crate) fn steps(num_steps: usize, t: f32) -> f32 { - ops::round(t * num_steps as f32) / num_steps.max(1) as f32 + ops::floor(t * num_steps as f32) / num_steps.max(1) as f32 } #[inline] diff --git a/crates/bevy_math/src/curve/mod.rs b/crates/bevy_math/src/curve/mod.rs index 659f4fee686c5..4facf60f5a6f1 100644 --- a/crates/bevy_math/src/curve/mod.rs +++ b/crates/bevy_math/src/curve/mod.rs @@ -1064,14 +1064,12 @@ mod tests { let curve = EasingCurve::new(start, end, EaseFunction::Steps(4)); [ (0.0, start), - (0.124, start), - (0.125, Vec2::new(0.25, 0.5)), - (0.374, Vec2::new(0.25, 0.5)), - (0.375, Vec2::new(0.5, 1.0)), - (0.624, Vec2::new(0.5, 1.0)), - (0.625, Vec2::new(0.75, 1.5)), - (0.874, Vec2::new(0.75, 1.5)), - (0.875, end), + (0.249, start), + (0.250, Vec2::new(0.25, 0.5)), + (0.499, Vec2::new(0.25, 0.5)), + (0.500, Vec2::new(0.5, 1.0)), + (0.749, Vec2::new(0.5, 1.0)), + (0.750, Vec2::new(0.75, 1.5)), (1.0, end), ] .into_iter()