fix: confined labels cutting off

`drawConfinedLabel` didn't take into account the starting x axis
when checking to break for exceeding `max_length`.

This should fix the box title not appearing on
terminals with larger column counts.
This commit is contained in:
RadsammyT 2025-07-16 22:03:51 -04:00
parent 1d4e32ba82
commit 5c3da10386
1 changed files with 1 additions and 1 deletions

View File

@ -220,7 +220,7 @@ pub fn drawConfinedLabel(self: TerminalBuffer, text: []const u8, x: usize, y: us
var i: c_int = @intCast(x);
while (utf8.nextCodepoint()) |codepoint| : (i += termbox.tb_wcwidth(codepoint)) {
if (i >= max_length) break;
if (i - @as(c_int, @intCast(x)) >= max_length) break;
_ = termbox.tb_set_cell(i, yc, codepoint, self.fg, self.bg);
}
}