aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/rect.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/rect.h b/common/rect.h
index 5d91fe496d..d01d910c3e 100644
--- a/common/rect.h
+++ b/common/rect.h
@@ -138,6 +138,17 @@ struct Rect {
}
/**
+ * Check if the given rect is equal to this one.
+ *
+ * @param r The rectangle to check
+ *
+ * @return true if the given rect is equal, false otherwise
+ */
+ bool equals(const Rect &r) const {
+ return (left == r.left) && (right == r.right) && (top == r.top) && (bottom == r.bottom);
+ }
+
+ /**
* Check if given rectangle intersects with this rectangle
*
* @param r the rectangle to check