mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-29 00:08:12 +00:00
chore: bump build date to 19 May 2026; fix UTF-8 ellipsis truncation
Fix drawTextEllipsized to strip orphaned UTF-8 leading bytes after byte-at-a-time trimming, preventing an invisible 6px gap before "..." when truncating non-ASCII names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,6 +80,12 @@ public:
|
||||
while (str_len > 0 && getTextWidth(temp_str) > max_width - ellipsis_width) {
|
||||
temp_str[--str_len] = 0;
|
||||
}
|
||||
// Strip any orphaned UTF-8 leading byte left by the byte-at-a-time trimming above.
|
||||
// A leading byte (0xC0-0xFF, high two bits = 11) with no following continuation
|
||||
// byte renders as an invisible 6px advance, leaving a gap before the ellipsis.
|
||||
while (str_len > 0 && ((uint8_t)temp_str[str_len - 1] & 0xC0) == 0xC0) {
|
||||
temp_str[--str_len] = 0;
|
||||
}
|
||||
strcat(temp_str, ellipsis);
|
||||
|
||||
setCursor(x, y);
|
||||
|
||||
Reference in New Issue
Block a user