lottie: fix precomposition with masking

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
parent c597365b99
commit a27839e80a

View file

@ -1248,8 +1248,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().release();
scene->push(cast(layer->scene));
layer->scene = scene;