From 0a59e02a218b3497aa50923fbf4497690af7e757 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Tue, 20 Aug 2024 16:15:55 +0900 Subject: [PATCH] api: corrected wrong const specifier Setter obvisouly modifies the instance. --- inc/thorvg.h | 6 +++--- src/bindings/capi/thorvg_capi.h | 2 +- src/bindings/capi/tvgCapi.cpp | 4 ++-- src/renderer/tvgPaint.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inc/thorvg.h b/inc/thorvg.h index b15e9631..37d9b21e 100644 --- a/inc/thorvg.h +++ b/inc/thorvg.h @@ -357,7 +357,7 @@ public: * * @note Experimental API */ - Result blend(BlendMethod method) const noexcept; + Result blend(BlendMethod method) noexcept; /** * @deprecated Use bounds(float* x, float* y, float* w, float* h, bool transformed) instead @@ -408,9 +408,9 @@ public: CompositeMethod composite(const Paint** target) const noexcept; /** - * @brief Gets the blending method of the object. + * @brief Retrieves the current blending method applied to the paint object. * - * @return The blending method + * @return The currently set blending method. * * @note Experimental API */ diff --git a/src/bindings/capi/thorvg_capi.h b/src/bindings/capi/thorvg_capi.h index ac4fbd73..0885fc6c 100644 --- a/src/bindings/capi/thorvg_capi.h +++ b/src/bindings/capi/thorvg_capi.h @@ -1028,7 +1028,7 @@ TVG_DEPRECATED TVG_API Tvg_Result tvg_paint_get_identifier(const Tvg_Paint* pain * * @note Experimental API */ -TVG_API Tvg_Result tvg_paint_set_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method method); +TVG_API Tvg_Result tvg_paint_set_blend_method(Tvg_Paint* paint, Tvg_Blend_Method method); /** diff --git a/src/bindings/capi/tvgCapi.cpp b/src/bindings/capi/tvgCapi.cpp index e9f8e653..93b43a00 100644 --- a/src/bindings/capi/tvgCapi.cpp +++ b/src/bindings/capi/tvgCapi.cpp @@ -237,10 +237,10 @@ TVG_API Tvg_Result tvg_paint_get_composite_method(const Tvg_Paint* paint, const } -TVG_API Tvg_Result tvg_paint_set_blend_method(const Tvg_Paint* paint, Tvg_Blend_Method method) +TVG_API Tvg_Result tvg_paint_set_blend_method(Tvg_Paint* paint, Tvg_Blend_Method method) { if (!paint) return TVG_RESULT_INVALID_ARGUMENT; - return (Tvg_Result) reinterpret_cast(paint)->blend((BlendMethod)method); + return (Tvg_Result) reinterpret_cast(paint)->blend((BlendMethod)method); } diff --git a/src/renderer/tvgPaint.cpp b/src/renderer/tvgPaint.cpp index dc0411b9..9f3f5b73 100644 --- a/src/renderer/tvgPaint.cpp +++ b/src/renderer/tvgPaint.cpp @@ -488,7 +488,7 @@ TVG_DEPRECATED uint32_t Paint::identifier() const noexcept } -Result Paint::blend(BlendMethod method) const noexcept +Result Paint::blend(BlendMethod method) noexcept { if (pImpl->blendMethod != method) { pImpl->blendMethod = method;