gdk: Add gdk_rectangle_equal()

There's enough users inside GTK to warrant this convenience function.
This commit is contained in:
Benjamin Otte
2015-09-13 16:00:22 +02:00
committed by Matthias Clasen
parent 5a561a8ddb
commit 2dad7c1319
5 changed files with 28 additions and 22 deletions

View File

@ -3655,16 +3655,6 @@ gtk_range_compute_slider_position (GtkRange *range,
}
}
static gboolean
rectangle_equal (const GdkRectangle *a,
const GdkRectangle *b)
{
return a->x == b->x
&& a->y == b->y
&& a->width == b->width
&& a->height == b->height;
}
static void
gtk_range_calc_slider (GtkRange *range)
{
@ -3675,7 +3665,7 @@ gtk_range_calc_slider (GtkRange *range)
gtk_adjustment_get_value (priv->adjustment),
&new_slider);
if (rectangle_equal (&priv->slider, &new_slider))
if (gdk_rectangle_equal (&priv->slider, &new_slider))
return;
gtk_range_queue_draw_location (range, MOUSE_SLIDER);