summaryrefslogtreecommitdiff
path: root/core/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/draw.zig')
-rw-r--r--core/draw.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/draw.zig b/core/draw.zig
index 28b9f22d..2ef72f0e 100644
--- a/core/draw.zig
+++ b/core/draw.zig
@@ -822,8 +822,9 @@ fn joinPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r
const chrome = p.chromeTheme();
const region = s.region(.tag, id).?;
const tag = (try tagline.shownTag(p, arena, pane)).text;
- // The tag's text rows; the band's under them are its own layer.
- const rows = pane.tag_rows - pane.band_rows;
+ // The tag's text rows; the band's under them are its own layer. A
+ // tag's own are MAX_TAG_ROWS at most (Pardes.sync).
+ const rows = @min(pane.tag_rows -| pane.band_rows, MAX_TAG_ROWS);
// As wide as the widest row it shows, and never narrower than its
// viewport.
var widest: usize = 0;
@@ -978,7 +979,7 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
const tx = r.x + @min(TAG_TEXT_INSET, r.w);
const tw = r.w -| TAG_TEXT_INSET;
const tag_y = p.tagTop(pane, r);
- const rows = pane.tag_rows - pane.band_rows;
+ const rows = @min(pane.tag_rows -| pane.band_rows, MAX_TAG_ROWS);
const page_rgb = th.bg orelse th.tag_bg;
// Focus is visible along the tag without changing its live text grid.
const tag_bg = tagGround(p, pane, active);