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 coding style in CutThroughShapeStrategy
Agata Cackoe2e4d6572b1c
diff --git a/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp b/plugins/tools/tool_knife/CutThroughShapeStrategy.cppindex 2604c53649..f6b9cfdc88 100644--- a/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp+++ b/plugins/tools/tool_knife/CutThroughShapeStrategy.cpp@@ -230,14 +230,12 @@ void CutThroughShapeStrategy::finishInteraction(Qt::KeyboardModifiers modifiers)QLineF rightLine = gapLines[1];---if (leftLine.length() == 0 || rightLine.length() == 0) {KIS_SAFE_ASSERT_RECOVER_RETURN(gapLine.length() != 0 && gapLines[0].length() != 0 && gapLines[1].length() != 0 && "Original gap lines shouldn't be empty at this point");return;}+ // -------------QPainterPath left, right, leftOpposite, rightOpposite;@@ -245,15 +243,15 @@ void CutThroughShapeStrategy::finishInteraction(Qt::KeyboardModifiers modifiers)QPolygonF gapLinePolygon;initializeGapShapes(outlineRect, leftLine, rightLine, left, right, leftOpposite, rightOpposite, gapLineRect, gapLinePolygon);- QList<KoShape*> newSelectedShapes;- QList<KoShape*> shapesToRemove;bool checkGapLineRect = !gapLineRect.isEmpty();+ QList<KoShape*> newSelectedShapes;+ QList<KoShape*> shapesToRemove;+ int affectedShapes = 0;QTransform booleanWorkaroundTransformInverted = booleanWorkaroundTransform.inverted();- int affectedShapes = 0;std::unique_ptr<KUndo2Command> cmd = std::unique_ptr<KUndo2Command>(new KUndo2Command(kundo2_i18n("Knife tool: cut through shapes")));new KoKeepShapesSelectedCommand(m_selectedShapes, {}, kisCanvas->selectedShapesProxy(), false, cmd.get());