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 crash when closing Krita while Calligraphy Tool is active

Dmitry Kazakovb9cba02f6695
diff --git a/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.cpp b/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.cpp
index a7884a13fb..0fedd0a64c 100644
--- a/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.cpp
+++ b/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.cpp
@@ -43,7 +43,6 @@ KarbonCalligraphyTool::KarbonCalligraphyTool(KoCanvasBase *canvas)
, m_selectedPath(0)
, m_isDrawing(false)
, m_speed(0, 0)
- , m_lastShape(0)
{
connect(canvas->selectedShapesProxy(), SIGNAL(selectionChanged()), SLOT(updateSelectedPath()));
@@ -138,7 +137,6 @@ void KarbonCalligraphyTool::mouseReleaseEvent(KoPointerEvent *event)
KUndo2Command *cmd = canvas()->shapeController()->addShape(m_shape, 0);
if (cmd) {
- m_lastShape = m_shape;
canvas()->addCommand(cmd);
canvas()->updateCanvas(m_shape->boundingRect());
} else {
@@ -351,7 +349,6 @@ void KarbonCalligraphyTool::activate(const QSet<KoShape*> &shapes)
useCursor(Qt::CrossCursor);
- m_lastShape = 0;
}
void KarbonCalligraphyTool::deactivate()
@@ -368,12 +365,6 @@ void KarbonCalligraphyTool::deactivate()
a = action("calligraphy_decrease_angle");
disconnect(a, 0, this, 0);
- if (m_lastShape && canvas()->shapeManager()->shapes().contains(m_lastShape)) {
- KoSelection *selection = canvas()->shapeManager()->selection();
- selection->deselectAll();
- selection->select(m_lastShape);
- }
-
KoToolBase::deactivate();
}
diff --git a/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.h b/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.h
index 7dbdde9264..8329fdedc0 100644
--- a/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.h
+++ b/plugins/tools/karbonplugins/tools/CalligraphyTool/KarbonCalligraphyTool.h
@@ -95,9 +95,6 @@ private:
// dynamic parameters
QPointF m_speed; // used as a vector
- // last calligraphic shape drawn, if any
- KarbonCalligraphicShape *m_lastShape;
-
KarbonCalligraphyOptionWidget *m_widget {0};
};