summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-21 21:05:10 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commitb730ce12667fb75c99b97eafcfc73d7b1f8bdd13 (patch)
treea04da809d8efe12687ed51d395deef258e7a5630 /src/draw.zig
parent2b0d9d607094739133470c10af51fd670cd63ed3 (diff)
downloadpardes-b730ce12667fb75c99b97eafcfc73d7b1f8bdd13.tar.gz
pardes-b730ce12667fb75c99b97eafcfc73d7b1f8bdd13.zip
GUI scrollbar thumb moves by the pixel and follows the glide
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig2
1 files changed, 2 insertions, 0 deletions
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