Commit fe7f1ee2 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix hiding onion skins when playing animation

We can reuse KisDecoratedNodeInterface for that. This interface
is normally used by Transform Tool.

BUG:426246

# Conflicts:
#	libs/ui/canvas/kis_animation_player.cpp
parent 3f8f763b
......@@ -40,6 +40,9 @@
#include <QFileInfo>
#include "KisSyncedAudioPlayback.h"
#include "kis_signal_compressor_with_param.h"
#include "kis_image_barrier_locker.h"
#include "kis_layer_utils.h"
#include "KisDecoratedNodeInterface.h"
#include "kis_image_config.h"
#include <limits>
......@@ -112,6 +115,7 @@ public:
KisSignalCompressor stopAudioOnScrubbingCompressor;
int audioOffsetTolerance;
QVector<KisNodeWSP> disabledDecoratedNodes;
void stopImpl();
......@@ -394,6 +398,16 @@ void KisAnimationPlayer::play()
}
m_d->canvas->setRenderingLimit(regionOfInterest);
} else {
KisImageBarrierLocker locker(m_d->canvas->image());
KisLayerUtils::recursiveApplyNodes(m_d->canvas->image()->root(),
[this] (KisNodeSP node) {
KisDecoratedNodeInterface *decoratedNode = dynamic_cast<KisDecoratedNodeInterface*>(node.data());
if (decoratedNode && decoratedNode->decorationsVisible()) {
decoratedNode->setDecorationsVisible(false, false);
m_d->disabledDecoratedNodes.append(node);
}
});
}
}
......@@ -477,6 +491,20 @@ void KisAnimationPlayer::Private::stopImpl()
q->disconnectCancelSignals();
timer->stop();
canvas->setRenderingLimit(QRect());
if (!canvas->frameCache()) {
KisImageBarrierLocker locker(canvas->image());
Q_FOREACH (KisNodeSP node, disabledDecoratedNodes) {
// we have just upgraded from a weak shared pointer
KIS_SAFE_ASSERT_RECOVER(node) { continue; }
KisDecoratedNodeInterface *decoratedNode = dynamic_cast<KisDecoratedNodeInterface*>(node.data());
KIS_SAFE_ASSERT_RECOVER(decoratedNode) { continue; }
decoratedNode->setDecorationsVisible(true);
}
}
}
bool KisAnimationPlayer::isPlaying()
......
Supports Markdown
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