From: Shinwoo Kim Date: Wed, 14 Oct 2020 08:26:14 +0000 (+0900) Subject: thorvg viewer: fix scale problem X-Git-Tag: submit/tizen/20201018.221456~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14346c8fc83098d273c26e8adf0949d6ae0d8f8a;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git thorvg viewer: fix scale problem If viewer calls load() with a data which does not have size changes of both viewbox and canvas, then load() does not set a scale value. This makes incorrect result on viewer side. So thorvg wasm should set a scale value, whenever load() is called. Change-Id: I2d29c56d9ae3295f86a2a78944f8cbd4a3cebbb4 --- diff --git a/src/wasm/thorvgwasm.cpp b/src/wasm/thorvgwasm.cpp index 8be8759..af3ce5b 100644 --- a/src/wasm/thorvgwasm.cpp +++ b/src/wasm/thorvgwasm.cpp @@ -28,7 +28,6 @@ public: bool load(string data, int width, int height) { - uint32_t pw, ph; float w, h; mErrorMsg = "None"; @@ -60,16 +59,10 @@ public: /* get default size */ mPicture->viewbox(nullptr, nullptr, &w, &h); - - pw = mDefaultWidth; - ph = mDefaultHeight; mDefaultWidth = static_cast(w); mDefaultHeight = static_cast(h); - if (pw != mDefaultWidth || ph != mDefaultHeight) { - updateScale(); - } - + updateScale(); updateSize(width, height); if (mSwCanvas->push(unique_ptr(mPicture)) != Result::Success) {