vxfw(App): re-add timers which haven't expired yet

This commit is contained in:
Tim Culverhouse 2024-11-01 15:34:29 -05:00
parent 6318b06653
commit 13e9e8ecfe

View file

@ -196,11 +196,14 @@ fn checkTimers(self: *App, ctx: *vxfw.EventContext) anyerror!void {
// timers are always sorted descending
while (self.timers.popOrNull()) |tick| {
if (now_ms < tick.deadline_ms)
if (now_ms < tick.deadline_ms) {
// re-add the timer
try self.timers.append(tick);
break;
}
try tick.widget.handleEvent(ctx, .tick);
try self.handleCommand(&ctx.cmds);
}
try self.handleCommand(&ctx.cmds);
}
const MouseHandler = struct {