From 6e8a6a63d45b2caef7b649d358f836e6cc4134d6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 24 Oct 2026 22:50:15 -0300 Subject: anim 11: a PDF's strip moves in the text's motion system: the integrator is animation.Follow (the Glide's, moved out), here the strip's lag behind document_scroll_y in pixels; whatever moves the core's position (a notch, a spin, PageDown, Ctrl-d/f, ge/gg, a Look at a page, Back, the rail) kicks it, a touchpad's fraction and a relayout move it directly; the pages a glide crosses render in its input's frame, a far jump's only where it comes to rest; a slow stream eases onto its mark (it ran into it at speed and passed it); pictures neither scroll nor pan --- src/pardes.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 0f3f87f2..829a7bfd 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -3690,7 +3690,9 @@ pub const Event = union(enum) { command: []const u8, /// Native shells may preserve sub-cell wheel distance in physical pixels. /// TTY button events still enter through the ordinary mouse path. - pdf_scroll: struct { pane: u8, delta_pixels: f32 }, + /// `glide`: a wheel's notch, which the strip glides; a touchpad's + /// fraction is followed as it comes. + pdf_scroll: struct { pane: u8, delta_pixels: f32, glide: bool = true }, pinch: f32, touch_scroll: f32, /// The host pointer left the drawable area. Unlike an out-of-range motion, @@ -6164,7 +6166,7 @@ pub const Pardes = struct { if (scroll.pane < MAX_PANES) { if (p.panes[scroll.pane]) |pane| { if (pane.hasPdf() and p.native_images) - _ = panes.Pdf.scrollPane(p, pane, @floatCast(scroll.delta_pixels)); + _ = panes.Pdf.scrollPane(p, pane, @floatCast(scroll.delta_pixels), scroll.glide); } } } @@ -7737,7 +7739,7 @@ pub const Pardes = struct { /// 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 p.cursor_glide.moving() or p.shell_continuous; + return p.cursor_glide.moving() or p.shell_continuous or panes.Pdf.moving(p); } /// For shells that only need a yes or no: macOS and the board, which -- cgit v1.3