lottie: hotfix a regression

a regression by the code refactoring:
5b30e2ad65
This commit is contained in:
Hermet Park 2025-02-25 18:54:04 +09:00
parent eb4b286da5
commit c5ca7b4b12

View file

@ -1177,6 +1177,7 @@ void LottieBuilder::updateMasks(LottieLayer* layer, float frameNo)
//the first mask
if (!pShape) {
pShape = layer->pooling();
pShape->reset();
auto compMethod = (method == MaskMethod::Subtract || method == MaskMethod::InvAlpha) ? MaskMethod::InvAlpha : MaskMethod::Alpha;
//Cheaper. Replace the masking with a clipper
if (layer->masks.count == 1 && compMethod == MaskMethod::Alpha) {
@ -1189,11 +1190,11 @@ void LottieBuilder::updateMasks(LottieLayer* layer, float frameNo)
//Chain mask composition
} else if (pMethod != method || pOpacity != opacity || (method != MaskMethod::Subtract && method != MaskMethod::Difference)) {
auto shape = layer->pooling();
shape->reset();
pShape->mask(shape, method);
pShape = shape;
}
pShape->reset();
pShape->trimpath(0.0f, 1.0f);
pShape->strokeWidth(0.0f);
pShape->fill(255, 255, 255, opacity);