From 29ce80c9a559d6226984db18e630da13f2f51eff Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 21 Nov 2026 04:08:45 +0000 Subject: [PATCH] Motion: a tween's last step keeps the run from replay without asking for another frame A tween that moves in a pass leaves its slot in another state than the run found it in, so a record of the run is not replayed; only a tween still running asks for a repaint. The last step of a modal's nudge asked for one more frame, so the dialog nudge trial saw a repaint after the nudge came to rest. --- crates/ui-contract/src/runtime/motion.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui-contract/src/runtime/motion.rs b/crates/ui-contract/src/runtime/motion.rs index f52cfa571..5fb7df0be 100644 --- a/crates/ui-contract/src/runtime/motion.rs +++ b/crates/ui-contract/src/runtime/motion.rs @@ -396,7 +396,8 @@ impl Driver<'_> { let now = frame::clock(ctx); let existing = if sizing { store::peek_clone::>(ctx, id) } else { store::take::>(ctx, id) }; // A tween that moves in this pass (a new target, also one it jumps to, or a step, also its last one) leaves the - // slot in another state than the run found it in, which the next run reads (`layer_fading` among others). + // slot in another state than the run found it in, which the next run reads (`layer_fading` among others): a + // record of the run is not replayed. Only a tween still running asks for another frame. let moved = existing.as_ref().is_some_and(|tween| tween.target() != target || !tween.is_settled()); let mut tween = match existing { Some(tween) => tween, @@ -410,8 +411,10 @@ impl Driver<'_> { self.advance(&mut tween, target, spec, now); let shown = tween.shown(); if !sizing { - if moved || !tween.is_settled() { + if !tween.is_settled() { note_unsettled(ctx); + } else if moved { + crate::runtime::replay::note_unsettled(ctx); } store::put(ctx, id, tween); }