[GRASS-SVN] r70405 - in grass/trunk/gui/wxpython: core vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 21 10:40:39 PST 2017
Author: martinl
Date: 2017-01-21 10:40:39 -0800 (Sat, 21 Jan 2017)
New Revision: 70405
Modified:
grass/trunk/gui/wxpython/core/settings.py
grass/trunk/gui/wxpython/vdigit/wxdisplay.py
Log:
wxGUI/vdigit: fix GetThreshold() (see #2848, see #3266)
Modified: grass/trunk/gui/wxpython/core/settings.py
===================================================================
--- grass/trunk/gui/wxpython/core/settings.py 2017-01-21 18:29:09 UTC (rev 70404)
+++ grass/trunk/gui/wxpython/core/settings.py 2017-01-21 18:40:39 UTC (rev 70405)
@@ -453,7 +453,8 @@
},
'selectThresh': {
'value': 10,
- 'units': 'screen pixels'
+ 'unit': 0, # new
+ 'units': 'screen pixels' # old for backwards comp.
},
'checkForDupl': {
'enabled': False
Modified: grass/trunk/gui/wxpython/vdigit/wxdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/wxdisplay.py 2017-01-21 18:29:09 UTC (rev 70404)
+++ grass/trunk/gui/wxpython/vdigit/wxdisplay.py 2017-01-21 18:40:39 UTC (rev 70405)
@@ -1107,12 +1107,16 @@
value = UserSettings.Get(group='vdigit', key=type, subkey='value')
if units is None:
- units = UserSettings.Get(group='vdigit', key=type, subkey='units')
+ units = UserSettings.Get(group='vdigit', key=type, subkey='unit')
+ if units is None:
+ # old for backwards comp.
+ units = UserSettings.Get(group='vdigit', key=type, subkey='units')
+ units = 0 if units == 'screen pixels' else 1
if value < 0:
value = (self.region['nsres'] + self.region['ewres']) / 2.0
- if units == 'screen pixels':
+ if units == 0:
# pixel -> cell
res = max(self.region['nsres'], self.region['ewres'])
return value * res
More information about the grass-commit
mailing list