mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
wasm: update picture size for file loading
The width and height was not changed, if there is newly loaded file. As a result, the scale was not correct after loading a file.
This commit is contained in:
parent
e9772efbd1
commit
54e5cdee10
1 changed files with 5 additions and 0 deletions
|
@ -55,6 +55,11 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* need to reset size to calculate scale in Picture.size internally
|
||||||
|
before calling updateSize */
|
||||||
|
mWidth = 0;
|
||||||
|
mHeight = 0;
|
||||||
|
|
||||||
updateSize(width, height);
|
updateSize(width, height);
|
||||||
|
|
||||||
if (mSwCanvas->push(unique_ptr<Picture>(mPicture)) != Result::Success) {
|
if (mSwCanvas->push(unique_ptr<Picture>(mPicture)) != Result::Success) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue