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/detached/wire.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/detached/wire.zig') diff --git a/src/detached/wire.zig b/src/detached/wire.zig index 9890dc1a..0e141686 100644 --- a/src/detached/wire.zig +++ b/src/detached/wire.zig @@ -12,7 +12,7 @@ const ShaderAnimation = pardes.config.Runtime.ShaderAnimation; /// to be refused, which is what this number is for. /// 8: one layer type: a tag band carries all its rows (not a layer per /// line), and a frame carries the core's placed regions after its layers. -pub const version: u16 = 11; +pub const version: u16 = 12; /// The Chrome palette is carried field by field as its declaration lists /// them, so any change to it changes the wire: bump `version`, then this. @@ -980,6 +980,7 @@ pub fn encodeClient(out: []u8, msg: ClientMsg) Error![]const u8 { .pdf_scroll => |s| { try w.writeByte(s.pane); try w.writeInt(u32, @bitCast(s.delta_pixels), .little); + try w.writeByte(@intFromBool(s.glide)); }, .pinch => |v| try w.writeInt(u32, @bitCast(v), .little), .touch_scroll => |v| try w.writeInt(u32, @bitCast(v), .little), @@ -1043,7 +1044,7 @@ pub fn decodeClient(tag: u8, payload: []const u8) Error!ClientMsg { }, .paste => .{ .event = .{ .paste = try getSlice32(&r) } }, .command => .{ .event = .{ .command = try r.take(try r.takeInt(u16, .little)) } }, - .pdf_scroll => .{ .event = .{ .pdf_scroll = .{ .pane = try getPane(&r), .delta_pixels = try getF32(&r) } } }, + .pdf_scroll => .{ .event = .{ .pdf_scroll = .{ .pane = try getPane(&r), .delta_pixels = try getF32(&r), .glide = try getBool(&r) } } }, .pinch => .{ .event = .{ .pinch = try getF32(&r) } }, .touch_scroll => .{ .event = .{ .touch_scroll = try getF32(&r) } }, .pointer_leave => .{ .event = .pointer_leave }, @@ -1297,9 +1298,10 @@ test "detached wire: every Event variant round-trips" { try testing.expectEqualStrings("clip", (try roundClient(&buf, .{ .event = .{ .paste = "clip" } })).event.paste); try testing.expectEqualStrings("Look /x", (try roundClient(&buf, .{ .event = .{ .command = "Look /x" } })).event.command); { - const got = (try roundClient(&buf, .{ .event = .{ .pdf_scroll = .{ .pane = 2, .delta_pixels = -12.5 } } })).event.pdf_scroll; + const got = (try roundClient(&buf, .{ .event = .{ .pdf_scroll = .{ .pane = 2, .delta_pixels = -12.5, .glide = false } } })).event.pdf_scroll; try testing.expectEqual(@as(u8, 2), got.pane); try testing.expectEqual(@as(f32, -12.5), got.delta_pixels); + try testing.expect(!got.glide); } try testing.expectEqual(@as(f32, 1.25), (try roundClient(&buf, .{ .event = .{ .pinch = 1.25 } })).event.pinch); try testing.expectEqual(@as(f32, -0.75), (try roundClient(&buf, .{ .event = .{ .touch_scroll = -0.75 } })).event.touch_scroll); -- cgit v1.3