From: Hermet Park Date: Mon, 5 Nov 2018 08:04:07 +0000 (+0900) Subject: lottianimation: fix incorrect animation in time stretch. X-Git-Tag: submit/tizen/20181129.071502~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83b433d4e4cc98f29dd3c113ee620f62d03dd512;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottianimation: fix incorrect animation in time stretch. Instead of applying startFrame at frameAtPos() but applied it at update() in generic way. This change could make apis useful at both raw frame control and normalized frame controls. This fixes "cue" animation sample. Change-Id: I0adfd73410291cdee95455b18ef8720482c81090 --- diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index f0086a6..2e9cd17 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -39,6 +39,8 @@ const std::vector &AnimationImpl::renderList(size_t frameNo, const VS bool AnimationImpl::update(size_t frameNo, const VSize &size) { + frameNo += mModel->startFrame(); + if (frameNo > mModel->endFrame()) frameNo = mModel->endFrame(); diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index d0a2e4c..3550b21 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -333,8 +333,7 @@ public: size_t frameAtPos(double pos) const { if (pos < 0) pos = 0; if (pos > 1) pos = 1; - return isStatic() ? startFrame() : - startFrame() + pos * frameDuration(); + return isStatic() ? 0 : pos * frameDuration(); } long frameAtTime(double timeInSec) const { return isStatic() ? startFrame() : frameAtPos(timeInSec / duration());