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
This commit is contained in:
alexanderalber
2026-10-09 10:28:40 -04:00
committed by GitHub
parent 34d5197370
commit b663be69b0
+6
View File
@@ -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 };