mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +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)) {
|
if (mask->pathset(frameNo, P(shape)->rs.path.cmds, P(shape)->rs.path.pts)) {
|
||||||
P(shape)->update(RenderUpdateFlag::Path);
|
P(shape)->update(RenderUpdateFlag::Path);
|
||||||
}
|
}
|
||||||
|
auto method = mask->method;
|
||||||
if (mergingMask) {
|
if (mergingMask) {
|
||||||
auto method = mask->method;
|
//false of false is true. invert.
|
||||||
if (method == CompositeMethod::SubtractMask && pmethod == method) {
|
if (method == CompositeMethod::SubtractMask && pmethod == method) {
|
||||||
method = CompositeMethod::AddMask;
|
method = CompositeMethod::AddMask;
|
||||||
} else if (pmethod == CompositeMethod::DifferenceMask && pmethod == method) {
|
} 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);
|
mergingMask->composite(cast<Shape>(shape), method);
|
||||||
} else {
|
} 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;
|
pmethod = mask->method;
|
||||||
mergingMask = shape;
|
mergingMask = shape;
|
||||||
|
|
Loading…
Add table
Reference in a new issue