[GRASS-SVN] r62829 - grass/trunk/gui/wxpython/rdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 19 20:23:34 PST 2014


Author: annakrat
Date: 2014-11-19 20:23:34 -0800 (Wed, 19 Nov 2014)
New Revision: 62829

Modified:
   grass/trunk/gui/wxpython/rdigit/controller.py
Log:
rdigit: finish drawing of line/area before saving or switching tools

Modified: grass/trunk/gui/wxpython/rdigit/controller.py
===================================================================
--- grass/trunk/gui/wxpython/rdigit/controller.py	2014-11-20 03:53:41 UTC (rev 62828)
+++ grass/trunk/gui/wxpython/rdigit/controller.py	2014-11-20 04:23:34 UTC (rev 62829)
@@ -154,7 +154,7 @@
         elif self._graphicsType == 'point':
             point = self._points.GetItem(-1)
             point.SetCoords([x, y])
-            self._finish(x, y)
+            self._finish()
         # draw
         self._mapWindow.ClearLines()
         self._lines.Draw(pdc=self._mapWindow.pdcTmp)
@@ -162,7 +162,7 @@
         self._points.Draw(pdc=self._mapWindow.pdcTmp)
         self._mapWindow.Refresh()
 
-    def _finish(self, x, y):
+    def _finish(self):
         """Finish digitizing a new object and redraws.
         Saves current cell value and buffer width for that object.
 
@@ -201,6 +201,11 @@
         Connects and disconnects signal to allow other tools
         in map toolbar to work.
         """
+        if self._graphicsType and drawingType and self._graphicsType != drawingType \
+                and self._drawing:
+            # if we select different drawing tool, finish the feature
+            self._finish()
+
         if self._graphicsType and not drawingType:
             self._mapWindow.ClearLines(pdc=self._mapWindow.pdcTmp)
             self._mapWindow.mouse['end'] = self._mapWindow.mouse['begin']
@@ -414,9 +419,12 @@
         keep the order of editing. These rasters are then patched together.
         Sets default color table for the newly digitized raster.
         """
-        if not self._editedRaster:
+        if not self._editedRaster or self._running:
             return
 
+        if self._drawing:
+            self._finish()
+
         if len(self._all) < 1:
             return
         tempRaster = 'tmp_rdigit_rast_' + str(os.getpid())



More information about the grass-commit mailing list