From b730ce12667fb75c99b97eafcfc73d7b1f8bdd13 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 21 Oct 2026 21:05:10 -0300 Subject: GUI scrollbar thumb moves by the pixel and follows the glide --- src/pdf_view.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pdf_view.zig') diff --git a/src/pdf_view.zig b/src/pdf_view.zig index 500f05f3..2a89ef01 100644 --- a/src/pdf_view.zig +++ b/src/pdf_view.zig @@ -2814,6 +2814,8 @@ pub fn draw( )); rail.thumb_y = @intCast(pos); rail.thumb_h = @intCast(@min(len, track_h -| pos)); + rail.thumb_at = @floatCast(state.document_scroll_y / @as(f64, @floatFromInt(total))); + rail.thumb_span = @as(f32, @floatFromInt(view.pixel_h)) / @as(f32, @floatFromInt(total)); s.fill(rail.rect.x, rail.rect.y, 1, rail.rect.h, .{ .bg = .{ .rgb = chrome.scroll_track } }); s.fill(rail.rect.x + 1, rail.rect.y, 1, rail.rect.h, .{ .bg = pane_bg }); s.fill(rail.rect.x, rail.rect.y + rail.thumb_y, 1, rail.thumb_h, .{ .bg = .{ .rgb = chrome.scroll_thumb } }); -- cgit v1.3