[FL-3583]Account for the "-" in line carry-over (#3038)

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Astra 2023-09-05 22:13:50 +09:00 committed by GitHub
parent 452e27b05e
commit 8cbb757533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -290,7 +290,8 @@ void elements_multiline_text_aligned(
} else if((y + font_height) > canvas_height(canvas)) {
line = furi_string_alloc_printf("%.*s...\n", chars_fit, start);
} else {
line = furi_string_alloc_printf("%.*s-\n", chars_fit, start);
// Account for the added "-" in length
line = furi_string_alloc_printf("%.*s-\n", chars_fit - 1, start);
}
canvas_draw_str_aligned(canvas, x, y, horizontal, vertical, furi_string_get_cstr(line));
furi_string_free(line);