altoslib: Remove debug output from AltosMap
[fw/altos] / altoslib / AltosMap.java
index 85f95eef9cfdf3af49cae55224b6d1b165dd9ae5..1504120cfd29cd5a6196ff81414e5411e98c1ad6 100644 (file)
@@ -109,6 +109,10 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener {
                return map_interface.height();
        }
 
+       public void debug(String format, Object ... arguments) {
+               map_interface.debug(format, arguments);
+       }
+
        public AltosPointInt floor(AltosPointDouble point) {
                return new AltosPointInt ((int) Math.floor(point.x / AltosMap.px_size) * AltosMap.px_size,
                                              (int) Math.floor(point.y / AltosMap.px_size) * AltosMap.px_size);
@@ -376,6 +380,11 @@ public class AltosMap implements AltosMapTileListener, AltosMapStoreListener {
                int dx = x - drag_start.x;
                int dy = y - drag_start.y;
 
+               if (transform == null) {
+                       debug("Transform not set in drag\n");
+                       return;
+               }
+
                AltosLatLon new_centre = transform.screen_lat_lon(new AltosPointInt(width() / 2 - dx, height() / 2 - dy));
                centre(new_centre);
                drag_start = new AltosPointInt(x, y);