bevy/crates
Rob Parrett f3d8eb8956
Fix rounding in steps easing function (#17743)
# Objective

While working on #17742, I noticed that the `Steps` easing function
looked a bit suspicious.


![image](https://github.com/user-attachments/assets/be8f07e4-2079-461f-8c23-56d4b689aed9)

Comparing to the options available in
[css](https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function/steps#description):


![image](https://github.com/user-attachments/assets/2c351519-c87f-483f-b5ff-63a9ee7b7b51)

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.

<img width="100" alt="image"
src="https://github.com/user-attachments/assets/1ec46270-72f2-4227-87e4-03de881548ab"
/>


## 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

<!-- Note to editors: this should be adjusted if 17744 is addressed, and
possibly combined with the notes from the PR that fixes it. -->

`EaseFunction::Steps` now behaves like css's default, "jump-end." If you
were relying on the old behavior, we plan on providing it. See
https://github.com/bevyengine/bevy/issues/17744.
2025-02-08 18:33:46 +00:00
..
bevy_a11y Add no_std Support to bevy_a11y (#17505) 2025-01-23 03:52:47 +00:00
bevy_animation Improved Entity Mapping and Cloning (#17687) 2025-02-06 22:13:41 +00:00
bevy_app Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
bevy_asset Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
bevy_audio Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
bevy_color Fixes #17508: bevy_color::Color constructor docs get docs matching underlying constructor (#17601) 2025-01-29 18:21:23 +00:00
bevy_core_pipeline Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
bevy_derive Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_dev_tools Smarter testbeds (#17573) 2025-01-31 22:38:39 +00:00
bevy_diagnostic Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
bevy_dylib Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_ecs Improved Entity Mapping and Cloning (#17687) 2025-02-06 22:13:41 +00:00
bevy_encase_derive Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_gilrs Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
bevy_gizmos Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
bevy_gltf Fix Maya-exported rigs by not trying to topologically sort glTF nodes. (#17641) 2025-02-02 13:53:55 +00:00
bevy_image Image::get_color_at and Image::set_color_at: Support 16-bit float values (#17550) 2025-01-31 00:36:11 +00:00
bevy_input added Hash to MouseScrollUnit; (#17538) 2025-01-26 22:24:50 +00:00
bevy_input_focus Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
bevy_internal Add support for specular tints and maps per the KHR_materials_specular glTF extension. (#14069) 2025-01-26 20:38:46 +00:00
bevy_log Move Resource trait to its own file (#17469) 2025-01-21 19:47:08 +00:00
bevy_macro_utils Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_math Fix rounding in steps easing function (#17743) 2025-02-08 18:33:46 +00:00
bevy_mesh Improved Entity Mapping and Cloning (#17687) 2025-02-06 22:13:41 +00:00
bevy_mikktspace Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_pbr Include the material bind group in the shadow batch set key. (#17738) 2025-02-08 07:43:45 +00:00
bevy_picking Fix a couple of doc typos (#17673) 2025-02-05 19:29:22 +00:00
bevy_platform_support Improve ergonomics of platform_support's Instant (#17577) 2025-02-02 15:50:48 +00:00
bevy_ptr Update safety docs for Ptr::assert_unique (#17394) 2025-01-16 03:25:19 +00:00
bevy_reflect Bump to uuid 1.13.1 and enable js on wasm targets (#17689) 2025-02-05 06:05:32 +00:00
bevy_remote Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
bevy_render Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
bevy_scene Improved Entity Mapping and Cloning (#17687) 2025-02-06 22:13:41 +00:00
bevy_sprite Weak handle migration (#17695) 2025-02-05 22:44:20 +00:00
bevy_state Fix link to states example (#17595) 2025-01-29 21:44:55 +00:00
bevy_tasks Move spin to bevy_platform_support out of other crates (#17470) 2025-01-23 05:27:02 +00:00
bevy_text Cold Specialization (#17567) 2025-02-05 18:31:20 +00:00
bevy_time Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
bevy_transform Warnings and docs for exponential denormalization in rotate functions (alternative to #17604) (#17646) 2025-02-03 22:02:12 +00:00
bevy_ui Missing UI glpyhs fix (#17729) 2025-02-07 19:41:18 +00:00
bevy_utils Move hashbrown and foldhash out of bevy_utils (#17460) 2025-01-23 16:46:08 +00:00
bevy_window Move spin to bevy_platform_support out of other crates (#17470) 2025-01-23 05:27:02 +00:00
bevy_winit Fix cursor hotspot out of bounds when flipping (#17571) 2025-02-02 18:22:34 +00:00