[GRASS-SVN] r33306 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 6 17:05:57 EDT 2008


Author: martinl
Date: 2008-09-06 17:05:57 -0400 (Sat, 06 Sep 2008)
New Revision: 33306

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
Log:
wxGUI: constrain display res fixes


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-09-06 17:31:46 UTC (rev 33305)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2008-09-06 21:05:57 UTC (rev 33306)
@@ -662,10 +662,11 @@
         if render:
             # update display size
             self.Map.ChangeMapSize(self.GetClientSize())
-            windres = False
-            if self.parent.compResolution.GetValue():
+            if self.parent.compResolution.IsChecked():
                 # use computation region resolution for rendering
                 windres = True
+            else:
+                windres = False
             self.mapfile = self.Map.Render(force=True, mapWindow=self.parent,
                                            windres=windres)
         else:

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py	2008-09-06 17:31:46 UTC (rev 33305)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/render.py	2008-09-06 21:05:57 UTC (rev 33306)
@@ -24,6 +24,8 @@
 import sys
 import glob
 import math
+import copy
+
 try:
     import subprocess
 except:
@@ -663,44 +665,50 @@
         """
         grass_region = ""
 
-        # adjust region settings to match monitor
-        if not windres:
-            self.region = self.AdjustRegion()
+        if windres:
+            compRegion = self.GetRegion()
+            region = copy.copy(self.region)
+            for key in ('nsres', 'ewres',
+                        'rows', 'cols', 'cells'):
+                region[key] = compRegion[key]
+        else:
+            # adjust region settings to match monitor
+            region = self.AdjustRegion()
         
         # read values from wind file
         try:
             for key in self.wind.keys():
                 if key == 'north':
                     grass_region += "north: %s; " % \
-                        (self.region['n'])
+                        (region['n'])
                     continue
                 elif key == "south":
                     grass_region += "south: %s; " % \
-                        (self.region['s'])
+                        (region['s'])
                     continue
                 elif key == "east":
                     grass_region += "east: %s; " % \
-                        (self.region['e'])
+                        (region['e'])
                     continue
                 elif key == "west":
                     grass_region += "west: %s; " % \
-                        (self.region['w'])
+                        (region['w'])
                     continue
                 elif key == "e-w resol":
                     grass_region += "e-w resol: %f; " % \
-                        (self.region['ewres'])
+                        (region['ewres'])
                     continue
                 elif key == "n-s resol":
                     grass_region += "n-s resol: %f; " % \
-                        (self.region['nsres'])
+                        (region['nsres'])
                     continue
                 elif key == "cols":
                     grass_region += 'cols: %d; ' % \
-                        self.region['cols']
+                        region['cols']
                     continue
                 elif key == "rows":
                     grass_region += 'rows: %d; ' % \
-                        self.region['rows']
+                        region['rows']
                     continue
                 else:
                     grass_region += key + ": "  + self.wind[key] + "; "



More information about the grass-commit mailing list