[GRASS-SVN] r54231 - grass/trunk/gui/wxpython/mapswipe

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 6 14:06:58 PST 2012


Author: annakrat
Date: 2012-12-06 14:06:58 -0800 (Thu, 06 Dec 2012)
New Revision: 54231

Modified:
   grass/trunk/gui/wxpython/mapswipe/frame.py
   grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py
Log:
wxGUI/mapswipe: fix zooming to map

Modified: grass/trunk/gui/wxpython/mapswipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/frame.py	2012-12-06 21:53:10 UTC (rev 54230)
+++ grass/trunk/gui/wxpython/mapswipe/frame.py	2012-12-06 22:06:58 UTC (rev 54231)
@@ -284,8 +284,10 @@
         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
 

Modified: grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py	2012-12-06 21:53:10 UTC (rev 54230)
+++ grass/trunk/gui/wxpython/mapswipe/g.gui.mapswipe.py	2012-12-06 22:06:58 UTC (rev 54231)
@@ -79,8 +79,8 @@
         frame.SetFirstRaster(first)
     if second:
         frame.SetSecondRaster(second)
-
-    frame.SetRasterNames()
+    if first or second:
+        frame.SetRasterNames()
     frame.ZoomToMap()
     frame.Show()
 



More information about the grass-commit mailing list