saver/gif: Fix a clipping issue.

The Lottie loader missed handling the base clipper resizing.
This patch addresses the issue.
This commit is contained in:
Hermet Park 2023-11-06 16:46:14 +09:00
parent acb67dad8c
commit 58311ee5c3
2 changed files with 6 additions and 2 deletions

View file

@ -274,6 +274,11 @@ bool LottieLoader::resize(Paint* paint, float w, float h)
Matrix m = {sx, 0, 0, 0, sy, 0, 0, 0, 1};
paint->transform(m);
//apply the scale to the base clipper
const Paint* clipper;
paint->composite(&clipper);
if (clipper) const_cast<Paint*>(clipper)->transform(m);
return true;
}

View file

@ -53,8 +53,7 @@ void GifSaver::run(unsigned tid)
//use the default fps
if (fps > 60.0f) fps = 60.0f; // just in case
if (mathZero(fps)) {
else if (mathZero(fps) || fps < 0.0f) {
fps = (animation->totalFrame() / animation->duration());
}