mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
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);
This commit is contained in:
parent
919b002068
commit
060564cc93
2 changed files with 5 additions and 4 deletions
|
@ -813,13 +813,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.
|
||||
|
@ -828,7 +829,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);
|
||||
|
||||
|
||||
/*!
|
||||
|
|
|
@ -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<const Paint*>(paint)->bounds(x, y, w, h, true);
|
||||
return (Tvg_Result) reinterpret_cast<const Paint*>(paint)->bounds(x, y, w, h, transformed);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue