mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
actor-box: Adds clutter_actor_box_union utility
When using ClutterActorBoxs for representing clip regions it can be convenient to be able to union multiple boxes together.
This commit is contained in:
parent
2da127dcff
commit
48a24a2e08
@ -9331,6 +9331,34 @@ clutter_actor_box_clamp_to_pixel (ClutterActorBox *box)
|
||||
box->y2 = ceilf (box->y2);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_actor_box_union:
|
||||
* @a: (in): the first #ClutterActorBox
|
||||
* @a: (in): a second #ClutterActorBox
|
||||
* @result: (out): the #ClutterActorBox representing a union of @a and
|
||||
* @b
|
||||
*
|
||||
* Unions the two boxes @a and @b and stores the result in @result.
|
||||
*
|
||||
* Since: 1.4
|
||||
*/
|
||||
void
|
||||
clutter_actor_box_union (ClutterActorBox *a,
|
||||
ClutterActorBox *b,
|
||||
ClutterActorBox *result)
|
||||
{
|
||||
g_return_if_fail (a != NULL);
|
||||
g_return_if_fail (b != NULL);
|
||||
g_return_if_fail (result != NULL);
|
||||
|
||||
result->x1 = MIN (a->x1, b->x1);
|
||||
result->y1 = MIN (a->y1, b->y1);
|
||||
|
||||
result->x2 = MAX (a->x2, b->x2);
|
||||
result->y2 = MAX (a->y2, b->y2);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
struct _ShaderData
|
||||
|
@ -169,6 +169,9 @@ void clutter_actor_box_interpolate (const ClutterActorBox *initial
|
||||
gdouble progress,
|
||||
ClutterActorBox *result);
|
||||
void clutter_actor_box_clamp_to_pixel (ClutterActorBox *box);
|
||||
void clutter_actor_box_union (ClutterActorBox *a,
|
||||
ClutterActorBox *b,
|
||||
ClutterActorBox *result);
|
||||
|
||||
/**
|
||||
* ClutterGeometry:
|
||||
|
Loading…
Reference in New Issue
Block a user