src/layers/edittools.cpp

changeset 324
d9bab5d22c98
parent 323
3c09c937848c
child 330
edb6c09cdd3c
--- a/src/layers/edittools.cpp	Sun Jul 03 21:47:44 2022 +0300
+++ b/src/layers/edittools.cpp	Sun Jul 03 21:49:02 2022 +0300
@@ -234,7 +234,7 @@
 			}
 		};
 		const glm::vec3 zvec = this->gridMatrix[2];
-		{
+		if (this->inputPolygon.bufferSize() >= 3) {
 			const glm::vec2 p1 = extremity(this->inputPolygon[0] + zvec);
 			const glm::vec2 p2 = extremity(this->inputPolygon[0] - zvec);
 			const glm::vec2 lateral = glm::normalize(glm::mat2{{0, 1}, {-1, 0}} * (p2 - p1));
@@ -248,8 +248,6 @@
 				const QPointF notch_s2 = s_notchcenter - notchsize * 0.5f * vecToQPoint(lateral);
 				painter->drawLine(notch_s1, notch_s2);
 			}
-		}
-		if (this->inputPolygon.polygonSize() >= 3) {
 			const opt<float> height = this->cylinderHeight();
 			if (height.has_value()) {
 				const glm::vec3 heightvec = height.value_or(0) * zvec;

mercurial