From b663be69b00ca2be4eb7ad6453b688905520a17b Mon Sep 17 00:00:00 2001 From: alexanderalber <90604107+alexanderalber@users.noreply.github.com> Date: Fri, 9 Oct 2026 16:28:40 +0200 Subject: [PATCH] Slide show: a click after a long pause plays its step instead of skipping it (#11) The step clock ran before the frame's input actions were applied. A click that started a step (PlayStep) was timed against the old step_start (when the slide was entered), so after waiting longer than the step's duration the step finished in the same frame: everything appeared at once, without animation. Input actions are now applied before the clock is read. generated with Claude Code --- crates/ui-egui/src/show.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/ui-egui/src/show.rs b/crates/ui-egui/src/show.rs index bba6ec2f..7d69dfbf 100644 --- a/crates/ui-egui/src/show.rs +++ b/crates/ui-egui/src/show.rs @@ -288,6 +288,12 @@ pub fn ui(app: &mut SlideApp, ui: &mut Ui) { if secondary && !show.ended { actions.push(show.state.prev(&doc)); } + // Apply input first: a step started by this click must restart the clock before it is read. + for a in actions.drain(..) { + if !show.apply(a, &doc, now) { + keep = false; + } + } // Step clock. let (step, playing) = (show.state.step, show.state.playing); let t_step = if playing { now - show.step_start } else { 0.0 };