diff --git a/inc/thorvg.h b/inc/thorvg.h index f6e8ec76..994e686b 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -1238,15 +1238,6 @@ public: */ uint32_t mesh(const Polygon** triangles) const noexcept; - /** - * @brief Gets the position and the size of the loaded SVG picture. - * - * @warning Please do not use it, this API is not official one. It could be modified in the next version. - * - * @BETA_API - */ - Result viewbox(float* x, float* y, float* w, float* h) const noexcept; - /** * @brief Creates a new Picture object. * diff --git a/src/bindings/capi/thorvg_capi.h b/src/bindings/capi/thorvg_capi.h index dc017487..77b50ed3 100644 --- a/src/bindings/capi/thorvg_capi.h +++ b/src/bindings/capi/thorvg_capi.h @@ -1920,14 +1920,6 @@ TVG_API Tvg_Result tvg_picture_set_size(Tvg_Paint* paint, float w, float h); TVG_API Tvg_Result tvg_picture_get_size(const Tvg_Paint* paint, float* w, float* h); -/*! -* \brief Gets the position and the size of the loaded picture. (BETA_API) -* -* \warning Please do not use it, this API is not official one. It can be modified in the next version. -*/ -TVG_API Tvg_Result tvg_picture_get_viewbox(const Tvg_Paint* paint, float* x, float* y, float* w, float* h); - - /** \} */ // end defgroup ThorVGCapi_Picture diff --git a/src/bindings/capi/tvgCapi.cpp b/src/bindings/capi/tvgCapi.cpp index 3f874967..f97dddaa 100644 --- a/src/bindings/capi/tvgCapi.cpp +++ b/src/bindings/capi/tvgCapi.cpp @@ -508,13 +508,6 @@ TVG_API Tvg_Result tvg_picture_get_size(const Tvg_Paint* paint, float* w, float* } -TVG_API Tvg_Result tvg_picture_get_viewbox(const Tvg_Paint* paint, float* x, float* y, float* w, float* h) -{ - if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->viewbox(x, y, w, h); -} - - /************************************************************************/ /* Gradient API */ /************************************************************************/ diff --git a/src/lib/tvgLoadModule.h b/src/lib/tvgLoadModule.h index ee7c0c11..cea5590b 100644 --- a/src/lib/tvgLoadModule.h +++ b/src/lib/tvgLoadModule.h @@ -31,11 +31,6 @@ namespace tvg class LoadModule { public: - //default view box, if any. - float vx = 0; - float vy = 0; - float vw = 0; - float vh = 0; float w = 0, h = 0; //default image size ColorSpace cs = ColorSpace::Unsupported; //must be clarified at open() diff --git a/src/lib/tvgPicture.cpp b/src/lib/tvgPicture.cpp index 95ae14b8..7de38b2c 100644 --- a/src/lib/tvgPicture.cpp +++ b/src/lib/tvgPicture.cpp @@ -75,13 +75,6 @@ Result Picture::load(uint32_t* data, uint32_t w, uint32_t h, bool copy) noexcept } -Result Picture::viewbox(float* x, float* y, float* w, float* h) const noexcept -{ - if (pImpl->viewbox(x, y, w, h)) return Result::Success; - return Result::InsufficientCondition; -} - - Result Picture::size(float w, float h) noexcept { if (pImpl->size(w, h)) return Result::Success; diff --git a/src/lib/tvgPictureImpl.h b/src/lib/tvgPictureImpl.h index e527cf06..f724f3d5 100644 --- a/src/lib/tvgPictureImpl.h +++ b/src/lib/tvgPictureImpl.h @@ -181,16 +181,6 @@ struct Picture::Impl return ret; } - bool viewbox(float* x, float* y, float* w, float* h) - { - if (!loader) return false; - if (x) *x = loader->vx; - if (y) *y = loader->vy; - if (w) *w = loader->vw; - if (h) *h = loader->vh; - return true; - } - bool size(float w, float h) { this->w = w; diff --git a/src/loaders/svg/tvgSvgLoader.h b/src/loaders/svg/tvgSvgLoader.h index 5c74184e..54bb4a53 100644 --- a/src/loaders/svg/tvgSvgLoader.h +++ b/src/loaders/svg/tvgSvgLoader.h @@ -54,6 +54,10 @@ private: SvgViewFlag viewFlag = SvgViewFlag::None; AspectRatioAlign align = AspectRatioAlign::XMidYMid; AspectRatioMeetOrSlice meetOrSlice = AspectRatioMeetOrSlice::Meet; + float vx = 0; + float vy = 0; + float vw = 0; + float vh = 0; bool header(); void clear(); diff --git a/test/capi/capiPicture.cpp b/test/capi/capiPicture.cpp index e2a31bc7..5b84cf52 100644 --- a/test/capi/capiPicture.cpp +++ b/test/capi/capiPicture.cpp @@ -123,15 +123,6 @@ TEST_CASE("Load Svg Data in Picture", "[capiPicture]") REQUIRE(w == Approx(wNew).epsilon(0.0000001)); REQUIRE(h == Approx(hNew).epsilon(0.0000001)); - - //Verify Position - float x, y; - REQUIRE(tvg_picture_get_viewbox(picture, &x, &y, &w, &h) == TVG_RESULT_SUCCESS); - REQUIRE(x == Approx(0).epsilon(0.0000001)); - REQUIRE(y == Approx(0).epsilon(0.0000001)); - REQUIRE(w == Approx(600).epsilon(0.0000001)); - REQUIRE(h == Approx(600).epsilon(0.0000001)); - REQUIRE(tvg_paint_del(picture) == TVG_RESULT_SUCCESS); }