Merge pull request 'fix: confined labels/box title cutting off' (#806) from radsammyt/ly:fix-confined-labels into master

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/806
Reviewed-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion 2025-07-17 10:39:08 +02:00
commit 35265f5e77
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);
}
}