Color: alway compare all values
This commit is contained in:
parent
180e1f77fa
commit
4414326b56
|
@ -99,19 +99,15 @@ namespace bwidgets
|
|||
// instances.
|
||||
[[nodiscard]] auto operator==(const Color other) const noexcept
|
||||
{
|
||||
return (_operate_on_colors && sdl_type.r == other().r
|
||||
&& sdl_type.g == other().g && sdl_type.b == other().b)
|
||||
|| (_operate_on_alpha && sdl_type.a == other().a);
|
||||
return sdl_type.r == other().r && sdl_type.g == other().g
|
||||
&& sdl_type.b == other().b && sdl_type.a == other().a;
|
||||
}
|
||||
|
||||
// Compare for inequality of the enabled channel values between two Color
|
||||
// instances.
|
||||
[[nodiscard]] auto operator!=(const Color other) const noexcept
|
||||
{
|
||||
return (sdl_type.r != other().r || sdl_type.g != other().g
|
||||
|| sdl_type.b != other().b)
|
||||
&& ((_operate_on_alpha && sdl_type.a != other().a)
|
||||
|| !_operate_on_alpha);
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue