summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 8b3687a0..54fe2df0 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -4290,6 +4290,12 @@ pub const Pardes = struct {
/// spring. `lift_serials` says whose it is, so a reused slot starts flat.
lifts: [MAX_PANES]animation.Spring = @splat(.{}),
lift_serials: [MAX_PANES]u32 = @splat(0),
+ /// The focused cursor's quad on its springs (animation.CursorGlide),
+ /// the pane and view origin it was last aimed in, and the last key or
+ /// click, which a blink holds for.
+ cursor_glide: animation.CursorGlide = .{},
+ cursor_view: struct { serial: u32 = 0, line: i64 = 0 } = .{},
+ input_ns: u64 = 0,
animate_theme_changes: bool = false,
native_images: bool = false,
/// The shell can take a changed image a few rows at a time (a texture row
@@ -5355,6 +5361,7 @@ pub const Pardes = struct {
}
switch (ev) {
.key, .mouse => {
+ if (ev == .key or ev.mouse.kind != .motion) p.input_ns = p.now_ns;
for (p.panes) |slot| {
if (slot) |pane| Messages.dismissMessage(p, pane);
}
@@ -6513,13 +6520,14 @@ pub const Pardes = struct {
return if (frames) |n| p.stepped_ns + n * animation.frame_ns else null;
}
+
/// A render-time animation is moving (a pane's lift): it is sampled at
/// each frame's own `now`, so while it moves the shell draws every loop
/// and its present (vsync) paces it, at the display's rate. `nextWake`
/// is for the stepped animations, which count frames of `frame_ns`.
pub fn continuous(p: *const Pardes) bool {
for (p.lifts) |spring| if (!spring.settled) return true;
- return false;
+ return p.cursor_glide.moving();
}
/// For shells that only need a yes or no: macOS and the board, which