From: subhransu mohanty Date: Thu, 1 Nov 2018 01:18:02 +0000 (+0900) Subject: lottie: Fix the issue of assuming the startframe of composition is always zero. X-Git-Tag: submit/tizen/20181129.071502~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3edf19165b56bc25f46b4c669bbb7d43ce1655ae;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie: Fix the issue of assuming the startframe of composition is always zero. use the start and end frame instead. Change-Id: I16cee8b8fbf651faa8c736d979bab51a07dbfa4d --- diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index 86edc96..f0086a6 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -39,8 +39,11 @@ const std::vector &AnimationImpl::renderList(size_t frameNo, const VS bool AnimationImpl::update(size_t frameNo, const VSize &size) { - if (frameNo > mModel->frameDuration()) - frameNo = mModel->frameDuration(); + if (frameNo > mModel->endFrame()) + frameNo = mModel->endFrame(); + + if (frameNo < mModel->startFrame()) + frameNo = mModel->startFrame(); mCompItem->resize(size); return mCompItem->update(frameNo); diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 34c4995..d0a2e4c 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -664,6 +664,7 @@ public: size_t frameDuration() const {return mRoot->frameDuration();} size_t frameRate() const {return mRoot->frameRate();} size_t startFrame() const {return mRoot->startFrame();} + size_t endFrame() const {return mRoot->endFrame();} size_t frameAtPos(double pos) const {return mRoot->frameAtPos(pos);} public: std::shared_ptr mRoot;