mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
loader/lottie: fix a broken masking feature.
the inverse alpha should keep its own value. previously, it's modified to alpha by a mistake.
This commit is contained in:
parent
7c669f622f
commit
22771b5d8a
1 changed files with 7 additions and 2 deletions
|
@ -588,8 +588,9 @@ static void _updateMaskings(LottieLayer* layer, int32_t frameNo)
|
|||
if (mask->pathset(frameNo, P(shape)->rs.path.cmds, P(shape)->rs.path.pts)) {
|
||||
P(shape)->update(RenderUpdateFlag::Path);
|
||||
}
|
||||
auto method = mask->method;
|
||||
if (mergingMask) {
|
||||
auto method = mask->method;
|
||||
//false of false is true. invert.
|
||||
if (method == CompositeMethod::SubtractMask && pmethod == method) {
|
||||
method = CompositeMethod::AddMask;
|
||||
} else if (pmethod == CompositeMethod::DifferenceMask && pmethod == method) {
|
||||
|
@ -597,7 +598,11 @@ static void _updateMaskings(LottieLayer* layer, int32_t frameNo)
|
|||
}
|
||||
mergingMask->composite(cast<Shape>(shape), method);
|
||||
} else {
|
||||
layer->scene->composite(cast<Shape>(shape), CompositeMethod::AlphaMask);
|
||||
if (method == CompositeMethod::SubtractMask) method = CompositeMethod::InvAlphaMask;
|
||||
else if (method == CompositeMethod::AddMask) method = CompositeMethod::AlphaMask;
|
||||
else if (method == CompositeMethod::IntersectMask) method = CompositeMethod::AlphaMask;
|
||||
else if (method == CompositeMethod::DifferenceMask) method = CompositeMethod::AlphaMask; //does this correct?
|
||||
layer->scene->composite(cast<Shape>(shape), method);
|
||||
}
|
||||
pmethod = mask->method;
|
||||
mergingMask = shape;
|
||||
|
|
Loading…
Add table
Reference in a new issue