summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/draw.zig b/src/draw.zig
index 187f2f4e..dbc7069d 100644
--- a/src/draw.zig
+++ b/src/draw.zig
@@ -450,7 +450,8 @@ fn renderPane(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r:
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 });
const k = pane.addon.?;
- if (k.thumb_span > 0) {
+ // (a body of no rows has no thumb: a pane squeezed to its tag)
+ if (k.thumb_span > 0 and rail.rect.h > 0) {
const track: f32 = @floatFromInt(rail.rect.h);
rail.thumb_y = @intFromFloat(@min(track - 1, @floor(k.thumb_at * track)));
rail.thumb_h = @intFromFloat(@min(track - @as(f32, @floatFromInt(rail.thumb_y)), @max(1, k.thumb_span * track)));