Ver código fonte

wxGUI: fixed https://trac.osgeo.org/grass/ticket/1766

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53527 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 anos atrás
pai
commit
b13ecb0fdc

+ 1 - 1
gui/wxpython/mapdisp/mapwindow.py

@@ -475,7 +475,7 @@ class BufferedWindow(MapWindow, wx.Window):
         
         self.Map.ChangeMapSize((width, height))
         ibuffer = wx.EmptyBitmap(max(1, width), max(1, height))
-        self.Map.Render(force = True, windres = False)
+        self.Map.Render(force = True, windres = self.frame.GetProperty('resolution'))
         img = self.GetImage()
         self.pdc.RemoveAll()
         self.Draw(self.pdc, img, drawid = 99)

+ 8 - 1
gui/wxpython/mapdisp/statusbar.py

@@ -31,6 +31,7 @@ This program is free software under the GNU General Public License
 @author Anna Kratochvilova <kratochanna gmail.com>
 """
 
+import copy
 import wx
 
 from wx.lib.newevent import NewEvent
@@ -770,7 +771,13 @@ class SbDisplayGeometry(SbTextItem):
         self.label = _("Display geometry")
         
     def Show(self):
-        region = self.mapFrame.GetMap().GetCurrentRegion()
+        region = copy.copy(self.mapFrame.GetMap().GetCurrentRegion())
+        if self.mapFrame.GetProperty('resolution'):
+            compRegion = self.mapFrame.GetMap().GetRegion(add3d = False)
+            region['rows'] = abs(int((region['n'] - region['s']) / compRegion['nsres']) + 0.5)
+            region['cols'] = abs(int((region['e'] - region['w']) / compRegion['ewres']) + 0.5)
+            region['nsres'] = compRegion['nsres']
+            region['ewres'] = compRegion['ewres']
         self.SetValue("rows=%d; cols=%d; nsres=%.2f; ewres=%.2f" %
                      (region["rows"], region["cols"],
                       region["nsres"], region["ewres"]))