Commit 433244e5 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix transform tool to work correctly with selection mask's overlay

parent b7a9efed
......@@ -522,6 +522,15 @@ void TransformStrokeStrategy::initStrokeCallback()
m_deactivatedSelections.append(m_selection);
}
KisSelectionMaskSP overlaySelectionMask =
dynamic_cast<KisSelectionMask*>(m_rootNode->graphListener()->graphOverlayNode());
if (overlaySelectionMask) {
overlaySelectionMask->selection()->setVisible(false);
overlaySelectionMask->setDirty();
m_deactivatedOverlaySelectionMask = overlaySelectionMask;
}
ToolTransformArgs initialTransformArgs;
m_processedNodes = fetchNodesList(m_mode, m_rootNode, m_workRecursively);
......@@ -573,6 +582,8 @@ void TransformStrokeStrategy::initStrokeCallback()
if (const KisTransformMask *mask = dynamic_cast<const KisTransformMask*>(node.data())) {
srcRect |= mask->sourceDataBounds();
} else if (const KisSelectionMask *mask = dynamic_cast<const KisSelectionMask*>(node.data())) {
srcRect |= mask->selection()->selectedExactRect();
} else {
srcRect |= node->exactBounds();
}
......@@ -644,6 +655,11 @@ void TransformStrokeStrategy::finishStrokeImpl(bool applyTransform, const ToolTr
node->projectionLeaf()->setTemporaryHiddenFromRendering(false);
}
if (m_deactivatedOverlaySelectionMask) {
m_deactivatedOverlaySelectionMask->selection()->setVisible(true);
m_deactivatedOverlaySelectionMask->setDirty();
}
if (applyTransform) {
KisStrokeStrategyUndoCommandBased::finishStrokeCallback();
} else {
......
......@@ -167,6 +167,7 @@ private:
KisNodeList m_processedNodes;
QList<KisSelectionSP> m_deactivatedSelections;
QList<KisNodeSP> m_hiddenProjectionLeaves;
KisSelectionMaskSP m_deactivatedOverlaySelectionMask;
const KisSavedMacroCommand *m_overriddenCommand = 0;
QVector<const KUndo2Command*> m_skippedWhileMergeCommands;
......
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