From d9c13623644f78ad855333502991623cac7e67dc Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 1 Oct 2021 19:15:39 +0900 Subject: [PATCH] capi: replaced bounds() api with the latest. The next api of c++ version has been deprecated Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h); instead, we introduce the next one under the beta. Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed); --- src/bindings/capi/thorvg_capi.h | 5 +++-- src/bindings/capi/tvgCapi.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bindings/capi/thorvg_capi.h b/src/bindings/capi/thorvg_capi.h index 6fadf18..fbe09a8 100644 --- a/src/bindings/capi/thorvg_capi.h +++ b/src/bindings/capi/thorvg_capi.h @@ -807,13 +807,14 @@ TVG_EXPORT Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint); /*! -* \brief Gets the bounding box of the Tvg_Paint object before any transformation. +* \brief Gets the bounding box of the Tvg_Paint object before any transformation. (BETA_API) * * \param[in] paint The Tvg_Paint object of which to get the bounds. * \param[out] x The x coordinate of the upper left corner of the object. * \param[out] y The y coordinate of the upper left corner of the object. * \param[out] w The width of the object. * \param[out] h The height of the object. +* \param[in] transformed if @c true, apply the transformation of the paint. * * \return Tvg_Result enumeration. * \retval TVG_RESULT_SUCCESS Succeed. @@ -822,7 +823,7 @@ TVG_EXPORT Tvg_Paint* tvg_paint_duplicate(Tvg_Paint* paint); * * \note Transformation of an object changes the returned values. */ -TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h); +TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed); /*! diff --git a/src/bindings/capi/tvgCapi.cpp b/src/bindings/capi/tvgCapi.cpp index 7c6eb5d..cb8d1f1 100644 --- a/src/bindings/capi/tvgCapi.cpp +++ b/src/bindings/capi/tvgCapi.cpp @@ -191,10 +191,10 @@ TVG_EXPORT Tvg_Result tvg_paint_get_opacity(Tvg_Paint* paint, uint8_t* opacity) } -TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h) +TVG_EXPORT Tvg_Result tvg_paint_get_bounds(const Tvg_Paint* paint, float* x, float* y, float* w, float* h, bool transformed) { if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->bounds(x, y, w, h, true); + return (Tvg_Result) reinterpret_cast(paint)->bounds(x, y, w, h, transformed); } -- 2.7.4