mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-01 10:21:59 +00:00
fix(ui): a space that overflows ends the wrapped line there
wrapLines carried the overflowing space's word to the next line too early, so bubbles wrapped short of their width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,7 +79,13 @@ struct FullscreenMsgView {
|
||||
// for it (it's below the font's first codepoint), so it also ate width.
|
||||
if (cp == '\n' || cp == '\r') { brk = cp_start; break; }
|
||||
uint16_t cw = display.getCodepointWidth(cp);
|
||||
if (width + cw > max_px && cp_start > seg) { p = cp_start; break; }
|
||||
if (width + cw > max_px && cp_start > seg) {
|
||||
// A space that doesn't fit is where this line ends: the word before
|
||||
// it fits whole, so it stays here instead of moving down.
|
||||
if (cp == ' ') last_sp = cp_start;
|
||||
p = cp_start;
|
||||
break;
|
||||
}
|
||||
if (cp == ' ') last_sp = cp_start;
|
||||
width += cw;
|
||||
last_fit = p;
|
||||
|
||||
Reference in New Issue
Block a user