mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-30 08:48:12 +00:00
fix(ui): honour newlines in message text instead of overdrawing lines
A message containing a line break drew two words on top of each other in the fullscreen reader. wrapLines() treated '\n' as an ordinary character: it measured it via getCodepointWidth() -- which reports a full 6px cell for it, since 0x0A sits below the font's first glyph -- and copied it into the wrapped line. Both display drivers' print() then acts on '\n' by resetting the cursor to x=0 and stepping down one row, so the tail of that line was drawn straight over the following one. wrapLines() now ends the line at '\n'/'\r' (CRLF counts as one break) and consumes the byte rather than emitting it, preserving blank lines the sender typed while still skipping degenerate empty wrap segments so the loop can't stall. This covers the fullscreen view and the history list's portrait bubbles, which share the function. drawTextEllipsized() folds newlines into spaces for the same reason: it draws one line clipped to max_width, and the compact one-line message previews in the landscape list feed it raw message bodies. A space keeps the words apart and measures the same, so the ellipsis maths is unchanged; for names and labels it's a no-op. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
- **Typing on CardKB right after cycling a T9 letter, then tapping that same T9 cell again quickly, could overwrite an unrelated character.** None of CardKB's direct actions — typing, moving the cursor with the arrows, or opening the placeholder picker with Tab — were invalidating the pending T9 cycle the way every on-screen keypress already does, so the next tap "continued" the cycle against a moved cursor.
|
||||
- **The keyboard's text preview could split a Cyrillic, Greek or accented character in half at the end of a line**, drawing garbage on both sides of the break, and fitted only half as much text per line as it had room for. Line breaks in the preview were counted in bytes rather than characters — every other part of the keyboard already counted characters.
|
||||
- **Caps-lock and one-shot Shift looked identical on the keyboard's ⇧ key**, so there was no way to tell whether the next letter alone or every following letter would be capitalised. Caps-lock is now marked with an underline on the key.
|
||||
- **A message containing a line break drew two words on top of each other.** Newlines the sender typed were treated as ordinary characters — measured as a blank 6px cell, then handed to the display, which moved back to the left edge one row down mid-line and drew the rest of it over the following line. Line breaks now end the line properly (blank lines included) in the fullscreen message view and the history list, and fold into a space in the one-line message previews.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user