Browse Source

wxGUI/mapswipe: fix zooming to map

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54231 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 years ago
parent
commit
a040c4d799
2 changed files with 6 additions and 4 deletions
  1. 4 2
      gui/wxpython/mapswipe/frame.py
  2. 2 2
      gui/wxpython/mapswipe/g.gui.mapswipe.py

+ 4 - 2
gui/wxpython/mapswipe/frame.py

@@ -284,8 +284,10 @@ class SwipeMapFrame(DoubleMapFrame):
         Set display extents to match selected raster (including NULLs)
         or vector map.
         """
-        self.GetFirstWindow().ZoomToMap(layers = self.Map.GetListOfLayers())
-        self.GetSecondWindow().ZoomToMap(layers = self.Map.GetListOfLayers())
+        if self.rasters['first']:
+            self.GetFirstWindow().ZoomToMap(layers = self.firstMap.GetListOfLayers())
+        if self.rasters['second']:
+            self.GetSecondWindow().ZoomToMap(layers = self.secondMap.GetListOfLayers())
         # needed again, don't know why
         self.firstMap.region = self.secondMap.region
 

+ 2 - 2
gui/wxpython/mapswipe/g.gui.mapswipe.py

@@ -79,8 +79,8 @@ def main():
         frame.SetFirstRaster(first)
     if second:
         frame.SetSecondRaster(second)
-
-    frame.SetRasterNames()
+    if first or second:
+        frame.SetRasterNames()
     frame.ZoomToMap()
     frame.Show()