From 3fbb9f24f841417505c540f142bd81d935c9be0e Mon Sep 17 00:00:00 2001 From: Astra <93453568+Astrrra@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:29:28 +0900 Subject: [PATCH] [FL-3583] Fix multiline aligned text going out of bounds (again) (#3084) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- applications/services/gui/elements.c | 1 + 1 file changed, 1 insertion(+) diff --git a/applications/services/gui/elements.c b/applications/services/gui/elements.c index 37ecfde4..a6ab84fb 100644 --- a/applications/services/gui/elements.c +++ b/applications/services/gui/elements.c @@ -290,6 +290,7 @@ void elements_multiline_text_aligned( } else if((y + font_height) > canvas_height(canvas)) { line = furi_string_alloc_printf("%.*s...\n", chars_fit, start); } else { + chars_fit -= 1; // account for the dash line = furi_string_alloc_printf("%.*s-\n", chars_fit, start); } canvas_draw_str_aligned(canvas, x, y, horizontal, vertical, furi_string_get_cstr(line));