mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
loader/lottie: fix a wrong precomp time remapping.
the remapped frame number should be applied to the only referenced precomp layer.
This commit is contained in:
parent
a49ac81543
commit
b5fcc90e5d
2 changed files with 3 additions and 3 deletions
|
@ -694,6 +694,8 @@ static void _updatePrecomp(LottieLayer* precomp, int32_t frameNo)
|
||||||
{
|
{
|
||||||
if (precomp->children.count == 0) return;
|
if (precomp->children.count == 0) return;
|
||||||
|
|
||||||
|
frameNo -= precomp->startFrame;
|
||||||
|
|
||||||
//TODO: skip if the layer is static.
|
//TODO: skip if the layer is static.
|
||||||
for (auto child = precomp->children.end() - 1; child >= precomp->children.data; --child) {
|
for (auto child = precomp->children.end() - 1; child >= precomp->children.data; --child) {
|
||||||
_updateLayer(precomp, static_cast<LottieLayer*>(*child), frameNo);
|
_updateLayer(precomp, static_cast<LottieLayer*>(*child), frameNo);
|
||||||
|
|
|
@ -148,9 +148,7 @@ int32_t LottieLayer::remap(int32_t frameNo)
|
||||||
if (timeRemap.frames) {
|
if (timeRemap.frames) {
|
||||||
frameNo = comp->frameAtTime(timeRemap(frameNo));
|
frameNo = comp->frameAtTime(timeRemap(frameNo));
|
||||||
}
|
}
|
||||||
|
return (int32_t)(frameNo / timeStretch);
|
||||||
if (type == Precomp) return (int32_t)(frameNo / timeStretch) - startFrame;
|
|
||||||
else return (int32_t)(frameNo / timeStretch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue