src/layers/edittools.cpp

changeset 307
4771720fe258
parent 306
6ad27b7d2697
child 309
d862721d19a3
--- a/src/layers/edittools.cpp	Wed Jun 29 14:43:42 2022 +0300
+++ b/src/layers/edittools.cpp	Wed Jun 29 16:19:05 2022 +0300
@@ -456,22 +456,14 @@
 		}
 		for (std::size_t i = 0; i < indices.size(); i += 3) {
 			if (mergedTriangles.cutTriangles.find(i) == mergedTriangles.cutTriangles.end()) {
-				Triangle triangle{
-					Triangle{
-						.p1 = this->polygon[indices[i]],
-						.p2 = this->polygon[indices[i + 1]],
-						.p3 = this->polygon[indices[i + 2]],
-					}
-				};
+				Colored<Triangle> tri = triangle(
+					this->polygon[indices[i]],
+					this->polygon[indices[i + 1]],
+					this->polygon[indices[i + 2]]);
 				if (shouldInvert < 0) {
-					invert(triangle);
+					invert(tri);
 				}
-				result.push_back(AppendToModel{
-					.newElement = Colored<Triangle>{
-						triangle,
-						MAIN_COLOR,
-					}
-				});
+				result.push_back(AppendToModel{tri});
 			}
 		}
 	}

mercurial