mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
feat(ui): trail map — small N arrow in the top-right corner
The projection is already north-up (positive latitude maps to smaller y), but until now nothing on the screen confirmed which way is which. Add a tiny 5×7 arrowhead + shaft with an "N" label above, anchored in the top-right of the map area. Drawn after the polyline so it sits above any path that crosses the corner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -436,6 +436,10 @@ private:
|
||||
project(_store->last(), ex, ey);
|
||||
drawStartMarker(display, sx, sy);
|
||||
drawCurrentMarker(display, ex, ey);
|
||||
|
||||
// North indicator in the top-right of the map area — the projection is
|
||||
// strictly north-up (y inverted from latitude), so the arrow is fixed.
|
||||
drawNorthArrow(display, area_x + area_w - 4, area_y + display.getLineHeight() + 1);
|
||||
}
|
||||
|
||||
// Bresenham line via 1×1 fillRect. Acceptable for occasional view renders.
|
||||
@@ -478,4 +482,19 @@ private:
|
||||
d.fillRect(cx + i, cy - i, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// North arrow + "N" label. Tip at (cx, cy), arrow body extends down for 6 px;
|
||||
// the "N" sits one line height above the tip.
|
||||
static void drawNorthArrow(DisplayDriver& d, int cx, int cy) {
|
||||
int lh = d.getLineHeight();
|
||||
int cw = d.getCharWidth();
|
||||
d.setCursor(cx - cw / 2, cy - lh);
|
||||
d.print("N");
|
||||
// arrowhead
|
||||
d.fillRect(cx, cy, 1, 1);
|
||||
d.fillRect(cx - 1, cy + 1, 3, 1);
|
||||
d.fillRect(cx - 2, cy + 2, 5, 1);
|
||||
// shaft
|
||||
d.fillRect(cx, cy + 3, 1, 4);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user