fix(nav/map): label the waypoint in the degenerate single-point case

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 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-03 23:56:53 +02:00
parent eb4175c4c4
commit 3ec578aad3

View File

@@ -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;
}