Simplify some code

Fri, 01 Jul 2022 13:41:46 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Fri, 01 Jul 2022 13:41:46 +0300
changeset 310
5d6639a9607f
parent 309
d862721d19a3
child 311
fab454611f9b

Simplify some code

src/layers/edittools.cpp file | annotate | diff | comparison | revisions
--- a/src/layers/edittools.cpp	Wed Jun 29 16:33:49 2022 +0300
+++ b/src/layers/edittools.cpp	Fri Jul 01 13:41:46 2022 +0300
@@ -420,15 +420,7 @@
 {
 	std::vector<ModelAction> result;
 	if (this->numpoints == 2) {
-		result.push_back(AppendToModel{
-			.newElement = Colored<LineSegment>{
-				LineSegment{
-					.p1 = this->polygon[0],
-					.p2 = this->polygon[1],
-				},
-				EDGE_COLOR,
-			}
-		});
+		result.push_back(AppendToModel{edge(this->polygon[0], this->polygon[1])});
 	}
 	else if (this->numpoints > 2) {
 		const glm::mat4 inverseGrid = glm::inverse(this->gridMatrix);

mercurial