Skip to content

armgit / krita

Public Imported from GitHub
0

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++

Cancel removing gutter when going over a whole shape

Agata Cackof4fbbd617910
diff --git a/plugins/tools/tool_knife/RemoveGutterStrategy.cpp b/plugins/tools/tool_knife/RemoveGutterStrategy.cpp
index 9d04cbfef0..e29937ccda 100644
--- a/plugins/tools/tool_knife/RemoveGutterStrategy.cpp
+++ b/plugins/tools/tool_knife/RemoveGutterStrategy.cpp
@@ -236,6 +236,16 @@ void RemoveGutterStrategy::finishInteraction(Qt::KeyboardModifiers modifiers)
qCritical() << ppVar(srcOutlines[shapeNewIndexes[1]].toFillPolygon());
#endif
+ if (shapeNewIndexes[0] == shapeNewIndexes[1]) {
+ // the same shape
+ // gotta ensure the mouseline starts and ends inside
+ bool insideP1 = KisAlgebra2D::isInsideShape(srcOutlines[shapeNewIndexes[0]], mouseLine.p1());
+ bool insideP2 = KisAlgebra2D::isInsideShape(srcOutlines[shapeNewIndexes[0]], mouseLine.p2());
+ if (!insideP1 || !insideP2) {
+ // it's from outside, it doesn't go over a gutter, then
+ return;
+ }
+ }