lottie: Fixed a regression in masking logic

The scene tree should be arranged prior to appending the masking.
This was caused by 838785d75a
This commit is contained in:
Hermet Park 2024-12-26 18:01:37 +09:00 committed by Hermet Park
parent 5e102dfd25
commit 713840eb42

View file

@ -1224,6 +1224,13 @@ void LottieBuilder::updateMaskings(LottieLayer* layer, float frameNo)
{
if (layer->masks.count == 0) return;
//Introduce an intermediate scene for embracing the matte + masking
if (layer->matteTarget) {
auto scene = Scene::gen();
scene->push(layer->scene);
layer->scene = scene;
}
Shape* pShape = nullptr;
MaskMethod pMethod;
uint8_t pOpacity;
@ -1277,13 +1284,6 @@ void LottieBuilder::updateMaskings(LottieLayer* layer, float frameNo)
pOpacity = opacity;
pMethod = method;
}
//Introduce an intermediate scene for embracing the matte + masking
if (layer->matteTarget) {
auto scene = Scene::gen();
scene->push(layer->scene);
layer->scene = scene;
}
}