diff --git a/docs/solo_features/tools_screen/tools_screen.md b/docs/solo_features/tools_screen/tools_screen.md index 95369c3a..044c4428 100644 --- a/docs/solo_features/tools_screen/tools_screen.md +++ b/docs/solo_features/tools_screen/tools_screen.md @@ -109,7 +109,7 @@ A waypoint is a saved spot — your car, camp, a water source — that you can n **Dropping a waypoint** — **Hold Enter → Mark here**. This captures the current GPS fix and opens the on-screen keyboard for a short label (up to 11 characters — e.g. `CAR`, `CAMP`, `H2O`). Leaving it blank auto-names it `WP1`, `WP2`, … Marking works whether or not the trail is being recorded; it needs a GPS fix (otherwise it reports *No GPS fix*). -**On the map** — saved waypoints show on the Trail Map view as a hollow diamond with the label's first character beside it. The map's bounding box always includes them, so off-track waypoints stay in frame; the map even renders waypoints when no trail is recorded. +**On the map** — saved waypoints show on the Trail Map view as a hollow diamond with the label's first two characters beside it (enough to tell nearby waypoints apart). The map's bounding box always includes them, so off-track waypoints stay in frame; the map even renders waypoints when no trail is recorded. **Navigating** — **Hold Enter → Waypoints** opens the list (each row shows the label and live distance). The list always begins with a synthetic **Trail start** row whenever a trail exists, so you can backtrack to where you began without having marked it. Select a row and press **Enter** to open the navigation view: diff --git a/examples/companion_radio/ui-new/TrailScreen.h b/examples/companion_radio/ui-new/TrailScreen.h index da4e9d8b..c1a5304a 100644 --- a/examples/companion_radio/ui-new/TrailScreen.h +++ b/examples/companion_radio/ui-new/TrailScreen.h @@ -694,8 +694,8 @@ private: 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 }; + char s[3] = { lbl[0], lbl[0] ? lbl[1] : (char)0, 0 }; + if (s[0] && ccx + 4 + (int)display.getTextWidth(s) <= area_x + area_w) { display.setCursor(ccx + 4, ccy - 3); display.print(s); } @@ -753,14 +753,15 @@ private: drawStartMarker(display, sx, sy); } - // Waypoints, with the label's first character beside the marker. + // Waypoints, with the first two label characters beside the marker so + // nearby waypoints can be told apart. for (int i = 0; i < nwp; i++) { const Waypoint& w = wp.at(i); int wx, wy; projectLL(w.lat_1e6, w.lon_1e6, wx, wy); drawWaypointMarker(display, wx, wy); - if (w.label[0] && wx + 3 + display.getCharWidth() <= area_x + area_w) { - char s[2] = { w.label[0], 0 }; - display.setCursor(wx + 3, wy - 3); + char s[3] = { w.label[0], w.label[0] ? w.label[1] : (char)0, 0 }; + if (s[0] && wx + 4 + (int)display.getTextWidth(s) <= area_x + area_w) { + display.setCursor(wx + 4, wy - 3); display.print(s); } }