Skip to content

Commit 56f766d

Browse files
committed
Fix word wrap whitespace bug
1 parent 6cce4ed commit 56f766d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/engine.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@ pub const Element = struct {
18501850
const is_cr = item.text != null and item.text.?.len == 1 and item.text.?[0] == '\n';
18511851
const size = text_height.pixel_size(display, item.texture);
18521852
// Would drawing this word overflow?
1853-
if ((x + size.width > wrap_at and line_word_count > 0) or is_cr) {
1853+
if ((x + word_spacing + size.width > wrap_at and line_word_count > 0) or is_cr) {
18541854
needed_width = @max(needed_width, x);
18551855
// Wrap to next line
18561856
x = 0;

0 commit comments

Comments
 (0)