summaryrefslogtreecommitdiff
path: root/gdk/gdkrectangle.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-09-13 16:00:22 +0200
committerMatthias Clasen <mclasen@redhat.com>2015-10-03 22:26:27 -0400
commit2dad7c131958c2f8e547f6181b491e90e11ce214 (patch)
treea1f230ead5ebeeecd3214b773387eefa70404e69 /gdk/gdkrectangle.c
parent5a561a8ddb9bf71f09dfe32f140677e17117465d (diff)
downloadgtk+-2dad7c131958c2f8e547f6181b491e90e11ce214.tar.gz
gdk: Add gdk_rectangle_equal()
There's enough users inside GTK to warrant this convenience function.
Diffstat (limited to 'gdk/gdkrectangle.c')
-rw-r--r--gdk/gdkrectangle.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdk/gdkrectangle.c b/gdk/gdkrectangle.c
index 404ffcad79..84abd2ffd7 100644
--- a/gdk/gdkrectangle.c
+++ b/gdk/gdkrectangle.c
@@ -133,6 +133,27 @@ gdk_rectangle_intersect (const GdkRectangle *src1,
return return_val;
}
+/**
+ * gdk_rectangle_equal:
+ * @rect1: a #GdkRectangle
+ * @rect2: a #GdkRectangle
+ *
+ * Checks if the two given rectangles are equal.
+ *
+ * Returns: %TRUE if the rectangles are equal.
+ *
+ * Since: 3.20
+ */
+gboolean
+gdk_rectangle_equal (const GdkRectangle *rect1,
+ const GdkRectangle *rect2)
+{
+ return rect1->x == rect2->x
+ && rect1->y == rect2->y
+ && rect1->width == rect2->width
+ && rect1->height == rect2->height;
+}
+
static GdkRectangle *
gdk_rectangle_copy (const GdkRectangle *rectangle)
{