@@ -73,6 +73,9 @@ namespace Polycode {
*/
Number maxY() const { return y + h; }
+ bool operator==(const Rectangle& rect) const;
+ bool operator!=(const Rectangle& rect) const { return !(*this == rect); }
+
/**
* X position
@@ -44,3 +44,11 @@ Rectangle Rectangle::Clipped(const Rectangle& rect) const
return result;
}
+bool Rectangle::operator==(const Rectangle& rect) const
+{
+ if( x == rect.x && y == rect.y && w == rect.w && h == rect.h)
+ return true;
+ return false;
+}