mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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
|
||||
}
|
||||
|
||||
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 g = green() + roundf(static_cast<float>(other.green() - green()) * weight);
|
||||
|
|
Loading…
Add table
Reference in a new issue