mirror of https://github.com/fairyglade/ly.git
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:
commit
35265f5e77
|
@ -220,7 +220,7 @@ pub fn drawConfinedLabel(self: TerminalBuffer, text: []const u8, x: usize, y: us
|
||||||
|
|
||||||
var i: c_int = @intCast(x);
|
var i: c_int = @intCast(x);
|
||||||
while (utf8.nextCodepoint()) |codepoint| : (i += termbox.tb_wcwidth(codepoint)) {
|
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);
|
_ = termbox.tb_set_cell(i, yc, codepoint, self.fg, self.bg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue