From d72c740ac63d831ea91fcc454ea0e109c1efb3c6 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 9 Jan 2025 00:04:18 +0900 Subject: [PATCH] common: properly update the clamp() A regression brokeage by da54c83b5fa327e96c4fa7b7994c52e8f1e1c932 --- src/common/tvgMath.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/tvgMath.cpp b/src/common/tvgMath.cpp index d2cb39b5..327c68b5 100644 --- a/src/common/tvgMath.cpp +++ b/src/common/tvgMath.cpp @@ -374,9 +374,7 @@ float Bezier::angle(float t) const uint8_t lerp(const uint8_t &start, const uint8_t &end, float t) { - auto result = static_cast(start + (end - start) * t); - tvg::clamp(result, 0, 255); - return static_cast(result); + return static_cast(tvg::clamp(static_cast(start + (end - start) * t), 0, 255)); } }