diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2019-04-05 22:04:52 +0300 |
---|---|---|
committer | Rebecca Worledge <rebecca.worledge@theqtcompany.com> | 2019-04-06 04:02:21 +0000 |
commit | 9e1fa065c1249393de3f901e5905c1047cfdc0c8 (patch) | |
tree | 83ff55e55681e093ee20ccdc04b043d0c073c7f8 | |
parent | 9b332f6533fdbfd73326782fb7dd47c2377a9f73 (diff) |
Fix changing the animation direction while animation is running
Change-Id: I337d944b1d7f571b28136113a1b60ef61352aaef
Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com>
-rw-r--r-- | src/imports/lottieanimation.cpp | 2 | ||||
-rw-r--r-- | src/imports/rasterrenderer/batchrenderer.cpp | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/imports/lottieanimation.cpp b/src/imports/lottieanimation.cpp index 931a9c0..bb3c510 100644 --- a/src/imports/lottieanimation.cpp +++ b/src/imports/lottieanimation.cpp @@ -549,6 +549,8 @@ void LottieAnimation::setDirection(LottieAnimation::Direction direction) m_direction = direction; emit directionChanged(); + + m_frameRenderThread->gotoFrame(this, m_currentFrame); } bool LottieAnimation::loadSource(QString filename) diff --git a/src/imports/rasterrenderer/batchrenderer.cpp b/src/imports/rasterrenderer/batchrenderer.cpp index f14eec1..fc3f4cc 100644 --- a/src/imports/rasterrenderer/batchrenderer.cpp +++ b/src/imports/rasterrenderer/batchrenderer.cpp @@ -116,6 +116,7 @@ bool BatchRenderer::gotoFrame(LottieAnimation *animator, int frame) << static_cast<void*>(animator) << "Goto frame:" << frame; entry->currentFrame = frame; + entry->animDir = animator->direction(); pruneFrameCache(entry); m_waitCondition.wakeAll(); return true; |