loader/lottie: Fix the incorrect precomp layer frame time

The frame number of the referenced layer should be
reduced by the precomp start frame.
This commit is contained in:
Hermet Park 2023-08-16 19:12:03 +09:00
parent c5c40885ca
commit 15c09f260f

View file

@ -80,8 +80,8 @@ int32_t LottieLayer::remap(int32_t frameNo)
frameNo = comp->frameAtTime(timeRemap(frameNo));
}
if (timeStretch == 1.0f) return frameNo;
return (int32_t)(frameNo / timeStretch);
if (type == Precomp) return (int32_t)(frameNo / timeStretch) - startFrame;
else return (int32_t)(frameNo / timeStretch);
}