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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 2 07:34:58 PST 2012


Author: annakrat
Date: 2012-12-02 07:34:58 -0800 (Sun, 02 Dec 2012)
New Revision: 54142

Modified:
   grass/trunk/gui/wxpython/mapswipe/frame.py
Log:
wxGUI/mapswipe: fix #1817

Modified: grass/trunk/gui/wxpython/mapswipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapswipe/frame.py	2012-12-02 12:43:14 UTC (rev 54141)
+++ grass/trunk/gui/wxpython/mapswipe/frame.py	2012-12-02 15:34:58 UTC (rev 54142)
@@ -279,7 +279,7 @@
         else:
             self.Render(self.GetSecondWindow())
 
-    def OnZoomToMap(self, event):
+    def ZoomToMap(self):
         """!
         Set display extents to match selected raster (including NULLs)
         or vector map.
@@ -289,12 +289,15 @@
         # needed again, don't know why
         self.firstMap.region = self.secondMap.region
 
+    def OnZoomToMap(self, event):
+        """!Zoom to map"""
+        self.ZoomToMap()
+
     def OnZoomBack(self, event):
         self.GetFirstWindow().ZoomBack()
         self.secondMap.region = self.firstMap.region
         self.Render(self.GetSecondWindow())
 
-
     def OnSelectRasters(self, event):
         """!Choose raster maps and rerender."""
         dlg = SwipeMapDialog(self, first = self.rasters['first'], second = self.rasters['second'])
@@ -311,6 +314,7 @@
                     message += _("Map <%s> not found.") % maps[1]
                 GError(parent = self, message = message)
                 dlg.Destroy()
+            self.ZoomToMap()
 
         dlg.Destroy()
         self.OnRender(event = None)
@@ -321,7 +325,6 @@
         if raster['fullname']:
             self.rasters['first'] = raster['fullname']
             self.SetLayer(name = raster['fullname'], mapInstance = self.GetFirstMap())
-            self.OnZoomToMap(event = None)
             return True
 
         return False
@@ -332,7 +335,6 @@
         if raster['fullname']:
             self.rasters['second'] = raster['fullname']
             self.SetLayer(name = raster['fullname'], mapInstance = self.GetSecondMap())
-            self.OnZoomToMap(event = None)
             return True
 
         return False



More information about the grass-commit mailing list