From: subhransu mohanty Date: Mon, 7 Jan 2019 05:07:02 +0000 (+0900) Subject: lottie/vector: don't use startFrame() of a layer when it has time remap. X-Git-Tag: accepted/tizen/unified/20190111.055210^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b853ddc2906c17867ceeb10271f7d2c172c6b0a6;p=platform%2Fcore%2Fuifw%2Flottie-player.git lottie/vector: don't use startFrame() of a layer when it has time remap. Change-Id: I62230a2f5d9447bf7fa7ff3c9ebeed7aaa90dfa3 --- diff --git a/src/lottie/lottieitem.cpp b/src/lottie/lottieitem.cpp index 11a6489..667142c 100644 --- a/src/lottie/lottieitem.cpp +++ b/src/lottie/lottieitem.cpp @@ -591,10 +591,9 @@ void LOTCompLayerItem::updateContent() if (mClipper && flag().testFlag(DirtyFlagBit::Matrix)) { mClipper->update(combinedMatrix()); } - + int mappedFrame = mLayerData->timeRemap(frameNo()); for (const auto &layer : mLayers) { - layer->update( mLayerData->timeRemap(frameNo()) - mLayerData->startFrame(), - combinedMatrix(), combinedAlpha()); + layer->update( mappedFrame, combinedMatrix(), combinedAlpha()); } } diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 47faccf..16a75d5 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -441,7 +441,12 @@ public: */ inline int LOTLayerData::timeRemap(int frameNo) const { - frameNo = mTimeRemap.isStatic() ? frameNo : + /* + * only consider startFrame() when there is no timeRemap. + * when a layer has timeremap bodymovin updates the startFrame() + * of all child layer so we don't have to take care of it. + */ + frameNo = mTimeRemap.isStatic() ? frameNo - startFrame(): mCompRef->frameAtTime(mTimeRemap.value(frameNo)); /* Apply time streatch if it has any. * Time streatch is just a factor by which the animation will speedup or slow