Add a rect-contains-rect function
Similar to the contains-point one.
This commit is contained in:
parent
9c637ccb41
commit
b2feb463bd
3 changed files with 31 additions and 0 deletions
|
@ -909,6 +909,34 @@ clutter_rect_contains_point (ClutterRect *rect,
|
||||||
(point->y <= (rect->origin.y + rect->size.height));
|
(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:
|
* clutter_rect_union:
|
||||||
* @a: a #ClutterRect
|
* @a: a #ClutterRect
|
||||||
|
|
|
@ -221,6 +221,8 @@ void clutter_rect_get_center (ClutterRect *rect,
|
||||||
ClutterPoint *center);
|
ClutterPoint *center);
|
||||||
gboolean clutter_rect_contains_point (ClutterRect *rect,
|
gboolean clutter_rect_contains_point (ClutterRect *rect,
|
||||||
ClutterPoint *point);
|
ClutterPoint *point);
|
||||||
|
gboolean clutter_rect_contains_rect (ClutterRect *a,
|
||||||
|
ClutterRect *b);
|
||||||
void clutter_rect_union (ClutterRect *a,
|
void clutter_rect_union (ClutterRect *a,
|
||||||
ClutterRect *b,
|
ClutterRect *b,
|
||||||
ClutterRect *res);
|
ClutterRect *res);
|
||||||
|
|
|
@ -998,6 +998,7 @@ clutter_property_transition_set_property_name
|
||||||
clutter_rect_alloc
|
clutter_rect_alloc
|
||||||
clutter_rect_clamp_to_pixel
|
clutter_rect_clamp_to_pixel
|
||||||
clutter_rect_contains_point
|
clutter_rect_contains_point
|
||||||
|
clutter_rect_contains_rect
|
||||||
clutter_rect_copy
|
clutter_rect_copy
|
||||||
clutter_rect_equals
|
clutter_rect_equals
|
||||||
clutter_rect_free
|
clutter_rect_free
|
||||||
|
|
Loading…
Add table
Reference in a new issue