1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 23:30:04 -04:00
Files
egui/crates
cui fliter ec9b708a95 Fix zero-duration value animations returning the previous value (#8469)
<!--
Please read the "Making a PR" section of
[`CONTRIBUTING.md`](https://github.com/emilk/egui/blob/main/CONTRIBUTING.md)
before opening a Pull Request!

* Keep your PR:s small and focused.
* The PR title is what ends up in the changelog, so make it descriptive!
* Keep PR description short and to the point! No long LLM slop.
* If applicable, add a screenshot or gif.
* If it is a non-trivial addition, consider adding a demo for it to
`egui_demo_lib`, or a new example.
* Do NOT open PR:s from your `master` branch, as that makes it hard for
maintainers to test and add commits to your PR.
* Remember to run `cargo fmt` and `cargo clippy`.
* Open the PR as a draft until a human has reviewed it
* When you have addressed a PR comment, mark it as resolved.

Please be patient! I will review your PR, but my time is limited!
-->

animate_value_with_time returned the previous value for one frame when
called with a zero duration because it calculated the current value
before updating the animation target.

Handle zero-duration animations before interpolation so they immediately
return and store the target value. Add a regression test covering
consecutive target changes.


* Closes <https://github.com/emilk/egui/issues/THE_RELEVANT_ISSUE>
* [x] I have followed the instructions in the PR template

Signed-off-by: cuishuang <imcusg@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
2026-09-03 13:48:23 +02:00
..
2026-08-26 06:09:32 +00:00