mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
feat(nav/map): show two label characters beside a waypoint marker
One character was too ambiguous to tell adjacent waypoints apart on the map. Draw the first two characters of the label (falling back to one when the label is a single char) in both the normal and degenerate map paths, and widen the right-edge fit guard to the rendered text width. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user