lottie: fix precomposition with masking
Some checks failed
Android / build_x86_64 (push) Has been cancelled
Android / build_aarch64 (push) Has been cancelled
iOS / build_x86_64 (push) Has been cancelled
iOS / build_arm64 (push) Has been cancelled
macOS / build (push) Has been cancelled
macOS / compact_test (push) Has been cancelled
macOS / unit_test (push) Has been cancelled
Ubuntu / build (push) Has been cancelled
Ubuntu / compact_test (push) Has been cancelled
Ubuntu / unit_test (push) Has been cancelled
Windows / build (push) Has been cancelled
Windows / compact_test (push) Has been cancelled
Windows / unit_test (push) Has been cancelled

A precomposition layer is clipped to its viewport.
If the same layer also had a mask that was optimized
using clipping, this clip was unintentionally overridden
by the viewport clipping. This conflict is now fixed.
This commit is contained in:
Mira Grudzinska 2025-05-21 00:41:10 +02:00 committed by Hermet Park
parent 55847bdcb3
commit 211fee73e2

View file

@ -1174,8 +1174,8 @@ void LottieBuilder::updateMasks(LottieLayer* layer, float frameNo)
{
if (layer->masks.count == 0) return;
//Introduce an intermediate scene for embracing the matte + masking
if (layer->matteTarget) {
//Introduce an intermediate scene for embracing matte + masking or precomp clipping + masking replaced by clipping
if (layer->matteTarget || layer->type == LottieLayer::Precomp) {
auto scene = Scene::gen();
scene->push(layer->scene);
layer->scene = scene;