mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 14:48:24 +00:00
common: properly update the clamp()
A regression brokeage by da54c83b5f
This commit is contained in:
parent
222e8a25a1
commit
d72c740ac6
1 changed files with 1 additions and 3 deletions
|
@ -374,9 +374,7 @@ float Bezier::angle(float t) const
|
||||||
|
|
||||||
uint8_t lerp(const uint8_t &start, const uint8_t &end, float t)
|
uint8_t lerp(const uint8_t &start, const uint8_t &end, float t)
|
||||||
{
|
{
|
||||||
auto result = static_cast<int>(start + (end - start) * t);
|
return static_cast<uint8_t>(tvg::clamp(static_cast<int>(start + (end - start) * t), 0, 255));
|
||||||
tvg::clamp(result, 0, 255);
|
|
||||||
return static_cast<uint8_t>(result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue