mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
feat(ui): a turn dial / compass rose on narrow navigation screens
navview::draw (Waypoints, trail back, Nearby, a message's location) shows a dial beside the lines, or under them on a tall screen (portrait e-ink) where that makes it larger: with a course a turn dial (the top is where you're heading, the arrow points at the target, "Turn R 55"), without it the compass rose. The 4.2" screens keep theirs. On a short screen (the 64 px OLED) the gap under the distance and the pitch of the lines give way so the ETA is not cut off at the bottom. sim_nav_waypoint() opens a waypoint's navigate view from the simulator page. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
15ac4d8f83
commit
52812d8235
@@ -138,6 +138,18 @@ inline void arrow(DisplayDriver& d, int cx, int cy, int r, int deg) {
|
||||
}
|
||||
}
|
||||
|
||||
// A turn dial of radius r round (cx, cy): the way you're heading is the top
|
||||
// (the mark in from the ring), and an arrow points at where to go from there
|
||||
// (`deg` clockwise from the top, 0 = straight on) -- turn until it points up.
|
||||
// `ahead` doubles the ring: you're on course.
|
||||
inline void turnDial(DisplayDriver& d, int cx, int cy, int r, int deg, bool ahead) {
|
||||
const int s = miniIconScale(d);
|
||||
circle(d, cx, cy, r);
|
||||
if (ahead) circle(d, cx, cy, r - d.sepH() - 1);
|
||||
d.fillRect(cx - s, cy - r + d.sepH() + 1, 2 * s, 3 * s + 1); // the top mark
|
||||
arrow(d, cx, cy + s, r - 4 * s - 2, deg); // a touch low: clear of the mark
|
||||
}
|
||||
|
||||
// A compass rose of radius r round (cx, cy), north up: the ring, a tick in at
|
||||
// each cardinal point, N in a gap at the top, and -- for deg >= 0 -- a needle
|
||||
// from the centre to the ring, towards deg.
|
||||
|
||||
Reference in New Issue
Block a user