diff options
author | Keith Packard <keithp@keithp.com> | 2015-06-22 23:21:05 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2015-06-22 23:21:05 -0700 |
commit | 1513693602c2a4cab0783833d1844c066edabb71 (patch) | |
tree | 6da3c064dae1fcafce04550b9946338e1f863db7 | |
parent | 87d2ab135b493486162d33ff172eba1f44dc0ce5 (diff) |
altosdroid: Fix line drawing to old tracker location
Selecting an old tracker would often fail to switch the bearing line
as it was using the map data instead of just using the local data for
the relavant tracker.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java index 12dd2f25..339b7894 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosMapOffline.java @@ -86,6 +86,7 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal AltosDroid altos_droid; AltosLatLon here; + AltosLatLon there; AltosLatLon pad; Canvas canvas; @@ -334,7 +335,7 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal } private void draw_positions() { - line.set_a(map.last_position); + line.set_a(there); line.set_b(here); line.paint(); draw_bitmap(pad, pad_bitmap, pad_off_x, pad_off_y); @@ -465,8 +466,12 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal rocket = new Rocket(serial, this); rockets.put(serial, rocket); } - if (t_state.gps != null) - rocket.set_position(new AltosLatLon(t_state.gps.lat, t_state.gps.lon), t_state.received_time); + if (t_state.gps != null) { + AltosLatLon latlon = new AltosLatLon(t_state.gps.lat, t_state.gps.lon); + rocket.set_position(latlon, t_state.received_time); + if (state.serial == serial) + there = latlon; + } if (state != null) rocket.set_active(state.serial == serial); } |