mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
LibGfx: remove constexpr, add noexcept on interpolate method
This removes `constexpr` from the interpolate method in Color.h and adds `noexcept`. The roundf call cannot be constexpr on clang. This is the only incompatibility preventing serenity from building under clang. I tested this on OSX Big Sur 11.3 and 11.3.1, and everything works with this change.
This commit is contained in:
parent
2045782a6e
commit
49999006ef
1 changed files with 1 additions and 1 deletions
|
@ -149,7 +149,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Color interpolate(const Color& other, float weight) const
|
Color interpolate(const Color& other, float weight) const noexcept
|
||||||
{
|
{
|
||||||
u8 r = red() + roundf(static_cast<float>(other.red() - red()) * weight);
|
u8 r = red() + roundf(static_cast<float>(other.red() - red()) * weight);
|
||||||
u8 g = green() + roundf(static_cast<float>(other.green() - green()) * weight);
|
u8 g = green() + roundf(static_cast<float>(other.green() - green()) * weight);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue