Change-Id: I62230a2f5d9447bf7fa7ff3c9ebeed7aaa90dfa3
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());
}
}
*/
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