src/geometry.cpp

changeset 372
b2914aaeec1a
parent 371
171d3f9638a9
child 373
e34d6a30b96d
--- a/src/geometry.cpp	Mon Apr 10 14:21:17 2023 +0300
+++ b/src/geometry.cpp	Mon Apr 10 14:25:19 2023 +0300
@@ -244,7 +244,7 @@
  * @param polygon
  * @return winding
  */
-Winding winding(const QPolygonF &polygon)
+winding_e calculate_polygon_winding(const QPolygonF &polygon)
 {
 	// based on https://stackoverflow.com/a/1165943
 	double sum = 0.0;
@@ -254,7 +254,7 @@
 		const QPointF& p2 = polygon[(i + 1) % polygon.size()];
 		sum += (p2.x() - p1.x()) * (p2.y() + p1.y());
 	}
-	return (sum < 0) ? Winding::Anticlockwise : Winding::Clockwise;
+	return (sum < 0) ? winding_e::anticlockwise : winding_e::clockwise;
 }
 
 /**

mercurial