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

Fix Knife Tool affecting text shapes

Agata Cacko3eb1880822b1
diff --git a/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp b/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
index 774e50947d..d1c8c1a810 100644
--- a/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
+++ b/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp
@@ -24,6 +24,7 @@
#include <kundo2command.h>
#include <KoKeepShapesSelectedCommand.h>
#include <QtMath>
+#include <KoSvgTextShape.h>
CutThroughShapeStrategy::CutThroughShapeStrategy(KoToolBase *tool, KoSelection *selection, const QList<KoShape *> &shapes, QPointF startPoint, const GutterWidthsConfig &width)
@@ -184,6 +185,15 @@ void CutThroughShapeStrategy::finishInteraction(Qt::KeyboardModifiers modifiers)
KoShape* referenceShape = m_allShapes[i];
bool wasSelected = m_selectedShapes.contains(referenceShape);
+
+ if (dynamic_cast<KoSvgTextShape*>(referenceShape)) {
+ // skip all text
+ if (wasSelected) {
+ newSelectedShapes << referenceShape;
+ }
+ continue;
+ }
+
if ((srcOutlines[i].boundingRect() & leftOpposite.boundingRect()).isEmpty()
|| (srcOutlines[i].boundingRect() & rightOpposite.boundingRect()).isEmpty()) {
// there is nothing on one side