mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
svg2png: rounding up svg width and height
The svg width/height values were cast to int, which could result in cutting off a small part of the image. Now, in the case of a non-integer size, it will be rounded up. @Issue: https://github.com/thorvg/thorvg/issues/1414
This commit is contained in:
parent
e8eef1af1d
commit
2a0a3950e6
1 changed files with 2 additions and 0 deletions
|
@ -98,6 +98,8 @@ public:
|
|||
picture->size(&fw, &fh);
|
||||
w = static_cast<uint32_t>(fw);
|
||||
h = static_cast<uint32_t>(fh);
|
||||
if (fw > w) w++;
|
||||
if (fh > h) h++;
|
||||
|
||||
if (w * h > SIZE_8K) {
|
||||
float scale = fw / fh;
|
||||
|
|
Loading…
Add table
Reference in a new issue