소스 검색

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 년 전
부모
커밋
a040c4d799
2개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  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)
         Set display extents to match selected raster (including NULLs)
         or vector map.
         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
         # needed again, don't know why
         self.firstMap.region = self.secondMap.region
         self.firstMap.region = self.secondMap.region
 
 

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

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