mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-20 19:24:53 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user