lottie: fix a regression bug of masking

InverseAlphaMasking should be applied as intended,
but it was mistakenly reverted to alpha.

regression in v0.14.0 by: 2c7a83406e
This commit is contained in:
Hermet Park 2024-07-02 18:51:21 +09:00 committed by Hermet Park
parent cbf124632f
commit e8f1790e58

View file

@ -1145,7 +1145,12 @@ static void _updateMaskings(LottieLayer* layer, float frameNo, LottieExpressions
if (pMask->pathset(frameNo, P(pShape)->rs.path.cmds, P(pShape)->rs.path.pts, nullptr, 0.0f, exps)) {
P(pShape)->update(RenderUpdateFlag::Path);
}
layer->scene->composite(tvg::cast(pShape), (pMethod == CompositeMethod::SubtractMask) ? CompositeMethod::InvAlphaMask : CompositeMethod::AlphaMask);
if (pMethod == CompositeMethod::SubtractMask || pMethod == CompositeMethod::InvAlphaMask) {
layer->scene->composite(tvg::cast(pShape), CompositeMethod::InvAlphaMask);
} else {
layer->scene->composite(tvg::cast(pShape), CompositeMethod::AlphaMask);
}
//Apply the subsquent masks
for (auto m = layer->masks.begin() + 1; m < layer->masks.end(); ++m) {