mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user