From b00b4395fb0321344e435332a09b62efe48f1932 Mon Sep 17 00:00:00 2001 From: frederic wagner Date: Thu, 29 Dec 2022 16:31:53 +0100 Subject: [PATCH] gipy: color current and next segment --- apps/gipy/ChangeLog | 1 + apps/gipy/TODO | 8 ++------ apps/gipy/app.js | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/apps/gipy/ChangeLog b/apps/gipy/ChangeLog index 40eb3d9a8..11899c3e1 100644 --- a/apps/gipy/ChangeLog +++ b/apps/gipy/ChangeLog @@ -70,3 +70,4 @@ * New setting to hide points and increase display speed. * Speed optimisations. * Estimated time of Arrival/Going back. + * Display current and next segment in red so that you know where to go. diff --git a/apps/gipy/TODO b/apps/gipy/TODO index 53c3530e2..9f5372190 100644 --- a/apps/gipy/TODO +++ b/apps/gipy/TODO @@ -1,10 +1,7 @@ -* bugs ++ use Bangle.project(latlong) ++ try to avoid camera turning when stopped but still work when walking -- when exactly on turn, distance to next point is still often 50m - -----> it does not buzz very often on turns - -- when going backwards we have a tendencing to get a wrong current_segment * additional features @@ -15,7 +12,6 @@ (and look at more than next point) - display distance to next water/toilet ? -- dynamic map rescale - display scale (100m) - compress path ? diff --git a/apps/gipy/app.js b/apps/gipy/app.js index 974ad2528..eec2396d8 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -334,11 +334,13 @@ class Status { } let hours = now.getHours().toString(); // now, distance to next point in meters - g.setFont("6x8:2").drawString( - "" + this.distance_to_next_point + "m", - 0, - g.getHeight() - 49 - ); + g.setFont("6x8:2") + .setColor(g.theme.fg) + .drawString( + "" + this.distance_to_next_point + "m", + 0, + g.getHeight() - 49 + ); let point_time = this.old_times[this.old_times.length - 1]; let done_in = point_time - this.starting_time - this.paused_time; @@ -458,7 +460,11 @@ class Status { let x = half_width - Math.round(rotated_x); // x is inverted let y = half_height + Math.round(rotated_y); if (previous_x !== null) { - g.setColor(g.theme.fg); + let segment_color = g.theme.fg; + if (i == this.current_segment + 1 || i == this.current_segment + 2) { + segment_color = 0xf800; + } + g.setColor(segment_color); g.drawLine(previous_x, previous_y, x, y); if (this.path.is_waypoint(i - 1)) {