From 3ec578aad34d25151b949c0e1260db88dea0b94e Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Wed, 3 Jun 2026 23:56:53 +0200 Subject: [PATCH] fix(nav/map): label the waypoint in the degenerate single-point case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the map collapses to one coordinate (e.g. a single waypoint with no trail and no GPS fix yet), the degenerate branch drew the waypoint marker but never its label — so it appeared as a bare diamond. Draw the first character of the waypoint's label beside the centred marker, matching the normal map path. Co-Authored-By: Claude Opus 4.8 --- examples/companion_radio/ui-new/TrailScreen.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/TrailScreen.h b/examples/companion_radio/ui-new/TrailScreen.h index bab0b01f..da4e9d8b 100644 --- a/examples/companion_radio/ui-new/TrailScreen.h +++ b/examples/companion_radio/ui-new/TrailScreen.h @@ -691,7 +691,15 @@ private: // Degenerate: everything at one coordinate — just centre the markers. if (min_lat == max_lat && min_lon == max_lon) { int ccx = area_x + area_w / 2, ccy = area_y + area_h / 2; - if (nwp > 0) drawWaypointMarker(display, ccx, ccy); + if (nwp > 0) { + drawWaypointMarker(display, ccx, ccy); + const char* lbl = wp.at(0).label; // single coincident spot — label it + if (lbl[0] && ccx + 4 + display.getCharWidth() <= area_x + area_w) { + char s[2] = { lbl[0], 0 }; + display.setCursor(ccx + 4, ccy - 3); + display.print(s); + } + } if (have_gps || have_trail) drawCurrentMarker(display, ccx, ccy); return; }