mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 03:54:25 +00:00
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:
parent
acb67dad8c
commit
58311ee5c3
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue