From c880c2b26e354effde746b417659c4ed2f1e7409 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Fri, 13 Dec 2024 13:56:02 +0100 Subject: [PATCH] correct text bounds --- src/ugui_text.c3 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ugui_text.c3 b/src/ugui_text.c3 index e88593e..15bcd28 100644 --- a/src/ugui_text.c3 +++ b/src/ugui_text.c3 @@ -21,11 +21,11 @@ fn Rect! Ctx.get_text_bounds(&ctx, String text, bool* update_atlas) if (n) { *update_atlas = true; } } else { text_bounds.h += line_height + line_gap; - if (line_len > text_bounds.w) { - text_bounds.w = line_len; - } line_len = 0; } + if (line_len > text_bounds.w) { + text_bounds.w = line_len; + } } return text_bounds; @@ -78,7 +78,7 @@ fn void! Ctx.text_unbounded(&ctx, String label, String text) .rect.color = uint_to_rgba(0x000000ff), }; ctx.cmd_queue.enqueue(&bounds)!; - + Point orig = { .x = c_elem.bounds.x, .y = c_elem.bounds.y,