src/algorithms/invert.cpp

changeset 1305
31627acdd4b5
parent 1304
bb3f43293cf8
child 1313
4baed9f54de3
--- a/src/algorithms/invert.cpp	Mon Mar 19 11:04:18 2018 +0200
+++ b/src/algorithms/invert.cpp	Mon Mar 19 12:24:59 2018 +0200
@@ -128,3 +128,18 @@
 		}
 	}
 }
+
+void invertPolygon(LDPolygon& polygon)
+{
+	switch (polygon.numPolygonVertices())
+	{
+	case 2:
+	case 3:
+		std::swap(polygon.vertices[0], polygon.vertices[1]);
+		break;
+
+	case 4:
+		std::swap(polygon.vertices[1], polygon.vertices[3]);
+		break;
+	}
+}

mercurial