altosdroid: Stack map markers with newest rocket on top
authorKeith Packard <keithp@keithp.com>
Sat, 20 Jun 2015 18:57:29 +0000 (11:57 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 23 Jun 2015 04:04:43 +0000 (21:04 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/src/org/altusmetrum/AltosDroid/AltosMapView.java

index 460a3a2..1572bf3 100644 (file)
@@ -79,7 +79,11 @@ public class AltosMapView extends View implements ScaleGestureDetector.OnScaleGe
                line.set_b(tab.here);
                line.paint();
                draw_bitmap(tab.pad, tab.pad_bitmap, tab.pad_off_x, tab.pad_off_y);
-               for (Rocket rocket : tab.rockets.values())
+
+               Rocket[]        rockets = tab.rockets.values().toArray(new Rocket[0]);
+
+               Arrays.sort(rockets);
+               for (Rocket rocket : rockets)
                        rocket.paint();
                draw_bitmap(tab.here, tab.here_bitmap, tab.here_off_x, tab.here_off_y);
        }