summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-24 22:50:15 -0300
committerGabriel Schneider <[email protected]>2026-10-25 01:30:09 -0300
commit6e8a6a63d45b2caef7b649d358f836e6cc4134d6 (patch)
tree0c1259e1fa04e72a8ccb9df18b2811dd94083098 /src/pardes.zig
parent0dc2dc053af20d6811bfbe09ab31b762862a53a6 (diff)
downloadpardes-6e8a6a63d45b2caef7b649d358f836e6cc4134d6.tar.gz
pardes-6e8a6a63d45b2caef7b649d358f836e6cc4134d6.zip
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
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig8
1 files changed, 5 insertions, 3 deletions
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