lottie: fix viewport clipping issue when resize

After resizing an animation, the base clipper for the viewport of the root scene did not update accordingly. This caused the animation to always be clipped by its initial size.

Additionally, this issue introduced a regression in v1 when the `Result Picture::size(float w, float h)` function was called.

issue: https://github.com/thorvg/thorvg/issues/3039
This commit is contained in:
Jinny You 2024-12-30 11:57:14 +07:00 committed by Hermet Park
parent 82dc41479e
commit 38a4465656

View file

@ -260,9 +260,8 @@ bool LottieLoader::resize(Paint* paint, float w, float h)
paint->transform(m);
//apply the scale to the base clipper
const Paint* clipper;
paint->mask(&clipper);
if (clipper) const_cast<Paint*>(clipper)->transform(m);
auto clipper = PAINT(paint)->clipper;
if (clipper) clipper->transform(m);
return true;
}