Commit d72098bf authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix outline offset when cancelling move tool's stroke

CCBUG:392014
parent da97ec92
......@@ -230,23 +230,7 @@ void KisToolMove::activate(ToolActivation toolActivation, const QSet<KoShape*> &
KisTool::activate(toolActivation, shapes);
QRect totalBounds;
Q_FOREACH (KisNodeSP node, this->selectedNodes()) {
if (node && node->projection()) {
totalBounds |= node->projection()->nonDefaultPixelArea();
}
}
if (image()->globalSelection()) {
totalBounds &= image()->globalSelection()->selectedRect();
}
m_startPosition = totalBounds.topLeft();
if (m_optionsWidget)
{
KisSignalsBlocker b(m_optionsWidget);
m_optionsWidget->slotSetTranslate(m_startPosition);
}
slotNodeChanged(this->selectedNodes());
}
......@@ -419,7 +403,7 @@ void KisToolMove::endStroke()
{
if (!m_strokeId) return;
KisImageWSP image = currentImage();
KisImageSP image = currentImage();
image->endStroke(m_strokeId);
m_strokeId.clear();
m_currentlyProcessingNodes.clear();
......@@ -431,12 +415,18 @@ void KisToolMove::cancelStroke()
{
if (!m_strokeId) return;
KisImageWSP image = currentImage();
KisImageSP image = currentImage();
image->cancelStroke(m_strokeId);
m_strokeId.clear();
m_currentlyProcessingNodes.clear();
m_moveInProgress = false;
emit moveInProgressChanged();
// we should reset m_startPosition into the original value when
// the stroke is cancelled
KisCanvas2 *canvas = dynamic_cast<KisCanvas2*>(this->canvas());
canvas->viewManager()->blockUntilOperationsFinishedForced(image);
slotNodeChanged(this->selectedNodes());
}
QWidget* KisToolMove::createOptionWidget()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment