Browse Source

Colour class: Fix missing const-qualifier from equality operator

Michael Ragazzon 3 years ago
parent
commit
77d83d77ba
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Include/RmlUi/Core/Colour.h

+ 2 - 2
Include/RmlUi/Core/Colour.h

@@ -87,11 +87,11 @@ public:
 	/// Equality operator.
 	/// @param[in] rhs The colour to compare this against.
 	/// @return True if the two colours are equal, false otherwise.
-	inline bool operator==(Colour rhs) { return red == rhs.red && green == rhs.green && blue == rhs.blue && alpha == rhs.alpha; }
+	inline bool operator==(Colour rhs) const { return red == rhs.red && green == rhs.green && blue == rhs.blue && alpha == rhs.alpha; }
 	/// Inequality operator.
 	/// @param[in] rhs The colour to compare this against.
 	/// @return True if the two colours are not equal, false otherwise.
-	inline bool operator!=(Colour rhs) { return !(*this == rhs); }
+	inline bool operator!=(Colour rhs) const { return !(*this == rhs); }
 
 	/// Auto-cast operator.
 	/// @return A pointer to the first value.