common: properly update the clamp()

A regression brokeage by da54c83b5f
This commit is contained in:
Hermet Park 2025-01-09 00:04:18 +09:00
parent 222e8a25a1
commit d72c740ac6

View file

@ -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<int>(start + (end - start) * t);
tvg::clamp(result, 0, 255);
return static_cast<uint8_t>(result);
return static_cast<uint8_t>(tvg::clamp(static_cast<int>(start + (end - start) * t), 0, 255));
}
}