mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 20:14:37 +00:00
gif: corrected the wrong aspect ratio scaling.
This commit is contained in:
parent
99b57dc2b8
commit
8a5d14c6b5
1 changed files with 5 additions and 1 deletions
|
@ -220,7 +220,11 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
animation->picture()->size(width, height);
|
||||
//keep the aspect ratio.
|
||||
float ow, oh;
|
||||
animation->picture()->size(&ow, &oh);
|
||||
float scale = static_cast<float>(width) / ow;
|
||||
animation->picture()->size(ow * scale, oh * scale);
|
||||
|
||||
auto saver = Saver::gen();
|
||||
if (!saver) {
|
||||
|
|
Loading…
Add table
Reference in a new issue