loader/lottie: fix a precomposition+matting.

the matting target with a precomp lost the referencing in
the building the structure. this fixes it.
This commit is contained in:
Hermet Park 2023-09-12 18:25:28 +09:00
parent cea63125a4
commit 6b3bd8b27a

View file

@ -885,11 +885,16 @@ static bool _buildPrecomp(LottieComposition* comp, LottieGroup* parent)
for (auto c = parent->children.data; c < parent->children.end(); ++c) {
auto child = static_cast<LottieLayer*>(*c);
//attach the referencing layer.
//attach the precomp layer.
if (child->refId) _buildReference(comp, child);
//parenting
if (child->matte.target) _bulidHierarchy(parent, child->matte.target);
if (child->matte.target) {
//parenting
_bulidHierarchy(parent, child->matte.target);
//precomp referencing
if (child->matte.target->refId) _buildReference(comp, child->matte.target);
}
if (child->pid != -1) _bulidHierarchy(parent, child);
}
return true;