[GRASS-SVN] r63077 - grass/trunk/gui/wxpython/vdigit

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 26 07:37:03 PST 2014


Author: mmetz
Date: 2014-11-26 07:37:03 -0800 (Wed, 26 Nov 2014)
New Revision: 63077

Modified:
   grass/trunk/gui/wxpython/vdigit/wxdigit.py
Log:
vector digitizer: fix #2439

Modified: grass/trunk/gui/wxpython/vdigit/wxdigit.py
===================================================================
--- grass/trunk/gui/wxpython/vdigit/wxdigit.py	2014-11-26 15:35:21 UTC (rev 63076)
+++ grass/trunk/gui/wxpython/vdigit/wxdigit.py	2014-11-26 15:37:03 UTC (rev 63077)
@@ -1766,13 +1766,7 @@
         if newline < 0:
             self._error.WriteLine()
             return (-1, None)
-        else:
-            fids.append(newline)
         
-        # break at intersection
-        if self._settings['breakLines']:
-            self._breakLineAtIntersection(newline, self.poPoints)
-            
         # add centroids for left/right area
         if ftype & GV_AREA:
             left = right = -1
@@ -1802,13 +1796,13 @@
                 if Vect_get_point_in_area(self.poMapInfo, left, byref(x), byref(y)) == 0:
                     Vect_reset_line(bpoints)
                     Vect_append_point(bpoints, x.value, y.value, 0.0)
-                    newline = Vect_write_line(self.poMapInfo, GV_CENTROID,
+                    newc = Vect_write_line(self.poMapInfo, GV_CENTROID,
                                               bpoints, self.poCats)
-                    if newline < 0:
+                    if newc < 0:
                         self._error.WriteLine()
                         return (len(fids), fids)
                     else:
-                        fids.append(newline)
+                        fids.append(newc)
                     
             if right > 0 and \
                     Vect_get_area_centroid(self.poMapInfo, right) == 0:
@@ -1817,16 +1811,21 @@
                 if Vect_get_point_in_area(self.poMapInfo, right, byref(x), byref(y)) == 0:
                     Vect_reset_line(bpoints)
                     Vect_append_point(bpoints, x.value, y.value, 0.0)
-                    newline =  Vect_write_line(self.poMapInfo, GV_CENTROID,
+                    newc =  Vect_write_line(self.poMapInfo, GV_CENTROID,
                                                bpoints, self.poCats)
-                    if newline < 0:
+                    if newc < 0:
                         self._error.WriteLine()
                         return (len(fids, fids))
                     else:
-                        fids.append(newline)
+                        fids.append(newc)
                     
             Vect_destroy_line_struct(bpoints)
-        
+
+        # break line or boundary at intersection
+        if self._settings['breakLines']:
+            if not self._breakLineAtIntersection(newline, self.poPoints):
+		fids.append(newline)
+
         self._addChangeset()
         
         if ftype & GV_AREA:



More information about the grass-commit mailing list