From 4d163cda49dce1513a7b8ef090f0a93dca91c8b6 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Tue, 19 May 2026 10:25:25 +0200 Subject: [PATCH] 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 --- examples/companion_radio/MyMesh.h | 2 +- src/helpers/ui/DisplayDriver.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/MyMesh.h b/examples/companion_radio/MyMesh.h index e6160a16..ba7f4221 100644 --- a/examples/companion_radio/MyMesh.h +++ b/examples/companion_radio/MyMesh.h @@ -8,7 +8,7 @@ #define FIRMWARE_VER_CODE 11 #ifndef FIRMWARE_BUILD_DATE -#define FIRMWARE_BUILD_DATE "12 May 2026" +#define FIRMWARE_BUILD_DATE "19 May 2026" #endif // Versioning: vX.Y = upstream base, plus.N = fork revision diff --git a/src/helpers/ui/DisplayDriver.h b/src/helpers/ui/DisplayDriver.h index 99ceb540..661ad81e 100644 --- a/src/helpers/ui/DisplayDriver.h +++ b/src/helpers/ui/DisplayDriver.h @@ -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);