mirror of https://github.com/fairyglade/ly.git
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:
parent
1d4e32ba82
commit
5c3da10386
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue