diff --git a/src/wasm/thorvgwasm.cpp b/src/wasm/thorvgwasm.cpp index fc2f7c15..7c8d34fe 100644 --- a/src/wasm/thorvgwasm.cpp +++ b/src/wasm/thorvgwasm.cpp @@ -55,6 +55,11 @@ public: return false; } + /* need to reset size to calculate scale in Picture.size internally + before calling updateSize */ + mWidth = 0; + mHeight = 0; + updateSize(width, height); if (mSwCanvas->push(unique_ptr(mPicture)) != Result::Success) {