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/draw.zig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/draw.zig') diff --git a/src/draw.zig b/src/draw.zig index 22a8dc2a..84575873 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -87,6 +87,8 @@ pub fn place(p: *Pardes, s: *Surface) void { const pos = (track_h * sb.offset) / total; rail.thumb_y = @intCast(@min(pos, track_h)); rail.thumb_h = @intCast(@min(len, track_h - rail.thumb_y)); + rail.thumb_at = @as(f32, @floatFromInt(sb.offset)) / @as(f32, @floatFromInt(total)); + rail.thumb_span = @as(f32, @floatFromInt(@max(1, sb.len))) / @as(f32, @floatFromInt(total)); } s.addRegion(rail); // Each notice a chip at the right edge, one to a row in the order -- cgit v1.3