mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
Add a rect-contains-rect function
Similar to the contains-point one.
This commit is contained in:
parent
9c637ccb41
commit
b2feb463bd
@ -909,6 +909,34 @@ clutter_rect_contains_point (ClutterRect *rect,
|
||||
(point->y <= (rect->origin.y + rect->size.height));
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_rect_contains_rect:
|
||||
* @a: a #ClutterRect
|
||||
* @b: a #ClutterRect
|
||||
*
|
||||
* Checks whether @a contains @b.
|
||||
*
|
||||
* The first rectangle contains the second if the union of the
|
||||
* two #ClutterRect is equal to the first rectangle.
|
||||
*
|
||||
* Return value: %TRUE if the first rectangle contains the second.
|
||||
*
|
||||
* Since: 1.12
|
||||
*/
|
||||
gboolean
|
||||
clutter_rect_contains_rect (ClutterRect *a,
|
||||
ClutterRect *b)
|
||||
{
|
||||
ClutterRect res;
|
||||
|
||||
g_return_val_if_fail (a != NULL, FALSE);
|
||||
g_return_val_if_fail (b != NULL, FALSE);
|
||||
|
||||
clutter_rect_union (a, b, &res);
|
||||
|
||||
return clutter_rect_equals (a, &res);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_rect_union:
|
||||
* @a: a #ClutterRect
|
||||
|
@ -221,6 +221,8 @@ void clutter_rect_get_center (ClutterRect *rect,
|
||||
ClutterPoint *center);
|
||||
gboolean clutter_rect_contains_point (ClutterRect *rect,
|
||||
ClutterPoint *point);
|
||||
gboolean clutter_rect_contains_rect (ClutterRect *a,
|
||||
ClutterRect *b);
|
||||
void clutter_rect_union (ClutterRect *a,
|
||||
ClutterRect *b,
|
||||
ClutterRect *res);
|
||||
|
@ -998,6 +998,7 @@ clutter_property_transition_set_property_name
|
||||
clutter_rect_alloc
|
||||
clutter_rect_clamp_to_pixel
|
||||
clutter_rect_contains_point
|
||||
clutter_rect_contains_rect
|
||||
clutter_rect_copy
|
||||
clutter_rect_equals
|
||||
clutter_rect_free
|
||||
|
Loading…
Reference in New Issue
Block a user