Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Improve performance within willShapeBeCutPrecise
Agata Cackoaeea1df25524
diff --git a/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp b/plugins/tools/tool_knife/CutThroughShapeStrategy.cppindex b1a0b53344..53ba7550cf 100644--- a/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp+++ b/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp@@ -130,16 +130,18 @@ bool CutThroughShapeStrategy::willShapeBeCutPrecise(const QPainterPath& srcOutli|| KisAlgebra2D::getLineSegmentCrossingLineIndexes(rightLine, srcOutline).count() > 0;- bool containsPointWithinGap = false;- Q_FOREACH(QPointF p, srcOutline.toFillPolygon()) {- if (gapLinePolygon.containsPoint(p, Qt::WindingFill)) {- containsPointWithinGap = true;- break;+ if (!bothGapLinePointsInside && !crossesGapLine) {+ bool containsPointWithinGap = false;+ Q_FOREACH(QPointF p, srcOutline.toFillPolygon()) {+ if (gapLinePolygon.containsPoint(p, Qt::WindingFill)) {+ containsPointWithinGap = true;+ break;+ }}- }- if (!bothGapLinePointsInside && !crossesGapLine && !containsPointWithinGap) {- return false;+ if (!containsPointWithinGap) {+ return false;+ }}return true;}