Fix:android:Handle overlay disable/enable correctly
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 16 Jun 2012 18:31:47 +0000 (18:31 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 16 Jun 2012 18:31:47 +0000 (18:31 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5146 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/android/src/org/navitproject/navit/NavitGraphics.java

index c79315b..d951863 100644 (file)
@@ -873,7 +873,20 @@ public class NavitGraphics
                // assume we are NOT in map view mode!
                if (parent_graphics == null)
                        in_map = (disable==0);
-               overlay_disabled = disable;
+               if (overlay_disabled != disable) {
+                       overlay_disabled = disable;
+                       if (parent_graphics) {
+                               int x = pos_x;
+                               int y = pos_y;
+                               int width = w;
+                               int height = h;
+                               if (pos_wraparound != 0 && x < 0) x += parent_graphics.w;
+                               if (pos_wraparound != 0 && y < 0) y += parent_graphics.h;
+                               if (pos_wraparound != 0 && width < 0) width += parent_graphics.w;
+                               if (pos_wraparound != 0 && height < 0) height += parent_graphics.h;
+                               canvas.invalidate(x,y,x+w,y+h);
+                       }
+               }
        }
 
        protected void overlay_resize(int x, int y, int w, int h, int alpha, int wraparond)