Commit 1ad3c805 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Properly fix updates of shape layers on applying legacy transformation

Two issues:

1) We need to explicitly ask shape layers to regenerate their projection
   and wait for that using a barrier.

2) It should happen inside the blocked-setdirty-calls block to make
   sure no intermediate results are visible to the user.

CCBUG:437886
parent 81d9f9c9
......@@ -546,6 +546,17 @@ void TransformStrokeStrategy::finishStrokeImpl(bool applyTransform, const ToolTr
QVector<KisStrokeJobData *> mutatedJobs;
auto restoreTemporaryHiddenNodes = [this] () {
Q_FOREACH (KisNodeSP node, m_hiddenProjectionLeaves) {
node->projectionLeaf()->setTemporaryHiddenFromRendering(false);
if (KisDelayedUpdateNodeInterface *delayedNode = dynamic_cast<KisDelayedUpdateNodeInterface*>(node.data())) {
delayedNode->forceUpdateTimedNode();
} else {
node->setDirty();
}
}
};
if (applyTransform) {
m_savedTransformArgs = args;
......@@ -566,6 +577,8 @@ void TransformStrokeStrategy::finishStrokeImpl(bool applyTransform, const ToolTr
args,
m_rootNode);
KritaUtils::addJobBarrier(mutatedJobs, restoreTemporaryHiddenNodes);
KritaUtils::addJobBarrier(mutatedJobs, [this] () {
m_updatesFacade->enableDirtyRequests();
m_updatesDisabled = false;
......@@ -573,6 +586,8 @@ void TransformStrokeStrategy::finishStrokeImpl(bool applyTransform, const ToolTr
m_updateData->compress();
runAndSaveCommand(toQShared(new KisUpdateCommandEx(m_updateData, m_updatesFacade, KisUpdateCommandEx::FINALIZING)), KisStrokeJobData::BARRIER, KisStrokeJobData::NORMAL);
});
} else {
KritaUtils::addJobBarrier(mutatedJobs, restoreTemporaryHiddenNodes);
}
KritaUtils::addJobBarrier(mutatedJobs, [this, applyTransform]() {
......@@ -580,13 +595,6 @@ void TransformStrokeStrategy::finishStrokeImpl(bool applyTransform, const ToolTr
selection->setVisible(true);
}
Q_FOREACH (KisNodeSP node, m_hiddenProjectionLeaves) {
node->projectionLeaf()->setTemporaryHiddenFromRendering(false);
if (!applyTransform) {
node->setDirty();
}
}
if (m_deactivatedOverlaySelectionMask) {
m_deactivatedOverlaySelectionMask->selection()->setVisible(true);
m_deactivatedOverlaySelectionMask->setDirty();
......
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