From 79114e735bc6696c5b5918e654a513d8e012c2bc Mon Sep 17 00:00:00 2001 From: Joseph Date: Fri, 29 May 2026 15:09:09 +0100 Subject: [PATCH 1/2] fix: `motiongfx::action::InterpActionBuilder::play` clamps the duration to a minimum delta time of `f32::MIN_POSITIVE` --- crates/motiongfx/src/action.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/motiongfx/src/action.rs b/crates/motiongfx/src/action.rs index c596ac4..de33f2b 100644 --- a/crates/motiongfx/src/action.rs +++ b/crates/motiongfx/src/action.rs @@ -421,7 +421,10 @@ impl InterpActionBuilder<'_, T> { pub fn play(self, duration: f32) -> TrackFragment { TrackFragment::single( self.inner.key, - ActionClip::new(self.id(), duration), + ActionClip::new( + self.id(), + duration.max(f32::MIN_POSITIVE), + ), ) } } From 9e3dc3ad0e9d37c03169c2e796a6946e297e174d Mon Sep 17 00:00:00 2001 From: Joseph Date: Fri, 29 May 2026 15:26:07 +0100 Subject: [PATCH 2/2] feat: added QOL function for playing instantaneous animations --- crates/motiongfx/src/action.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/motiongfx/src/action.rs b/crates/motiongfx/src/action.rs index de33f2b..d573c8a 100644 --- a/crates/motiongfx/src/action.rs +++ b/crates/motiongfx/src/action.rs @@ -427,6 +427,11 @@ impl InterpActionBuilder<'_, T> { ), ) } + /// Plays an animation instantaneously (shorthand for [`Self::play`]\ (0.0)) + #[inline] + pub fn instant(self) -> TrackFragment { + self.play(0.0) + } } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]