src/toolsets/algorithmtoolset.cpp

changeset 1269
ec691d9472b3
parent 1263
0256edecda54
child 1288
d1e45f90654b
--- a/src/toolsets/algorithmtoolset.cpp	Sat Mar 03 17:59:56 2018 +0200
+++ b/src/toolsets/algorithmtoolset.cpp	Mon Mar 05 22:40:34 2018 +0200
@@ -69,8 +69,10 @@
 		// │   │  --→  │ ╱    ╱ │
 		// │   │  --→  │╱    ╱  │
 		// 1───2       1    1───2
-		LDTriangle* triangle1 = currentDocument()->emplaceReplacementAt<LDTriangle>(index.row(), v0, v1, v3);
-		LDTriangle* triangle2 = currentDocument()->emplaceAt<LDTriangle>(index.row() + 1, v1, v2, v3);
+		int row = index.row();
+		currentDocument()->removeAt(index);
+		LDTriangle* triangle1 = currentDocument()->emplaceAt<LDTriangle>(row, v0, v1, v3);
+		LDTriangle* triangle2 = currentDocument()->emplaceAt<LDTriangle>(row + 1, v1, v2, v3);
 
 		// The triangles also inherit the quad's color
 		triangle1->setColor(color);

mercurial