瀏覽代碼

Fix severe performance drop while deflating polylines

Underscaled arc tolerance produced very small values so that changes
to this parameter were negligible when scaled internally, hence significant
performance drop (lots of intermediate points inserted in an arc). Now the
performance is mostly the same compared to other types of offsetting
(SQUARE, MITER).
Andrii Doroshenko (Xrayez) 5 年之前
父節點
當前提交
749d917424
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/math/geometry.cpp

+ 1 - 1
core/math/geometry.cpp

@@ -1158,7 +1158,7 @@ Vector<Vector<Point2> > Geometry::_polypath_offset(const Vector<Point2> &p_polyp
 		case END_SQUARE: et = etOpenSquare; break;
 		case END_ROUND: et = etOpenRound; break;
 	}
-	ClipperOffset co;
+	ClipperOffset co(2.0, 0.25 * SCALE_FACTOR); // Defaults from ClipperOffset.
 	Path path;
 
 	// Need to scale points (Clipper's requirement for robust computation).