Parcourir la source

vedit vector lib: forward port https://trac.osgeo.org/grass/changeset/58512 and https://trac.osgeo.org/grass/changeset/58516 (fixing https://trac.osgeo.org/grass/ticket/719: unexpected line with v.edit tool=break)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67577 15284696-431f-4ddb-bdfa-cd5b030d7da7
Moritz Lennert il y a 9 ans
Parent
commit
a8f9340d14
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      lib/vector/vedit/break.c

+ 5 - 1
lib/vector/vedit/break.c

@@ -85,6 +85,7 @@ int Vedit_split_lines(struct Map_info *Map, struct ilist *List,
 	    G_debug(3, "Vedit_split_lines(): line=%d", line);
 
 	    /* copy first line part */
+	    Vect_reset_line(Points2);
 	    for (l = 0; l < seg; l++) {
 		Vect_append_point(Points2, x[l], y[l], z[l]);
 	    }
@@ -93,7 +94,10 @@ int Vedit_split_lines(struct Map_info *Map, struct ilist *List,
 	    Vect_append_point(Points2, px, py, 0.0);
 
 	    /* rewrite the line */
-	    newline = Vect_rewrite_line(Map, line, type, Points2, Cats);
+            if (j == 0)
+                newline = Vect_rewrite_line(Map, line, type, Points2, Cats);
+            else
+                newline = Vect_write_line(Map, type, Points2, Cats);
 	    if (newline < 0) {
 		return -1;
 	    }