clutter/actor-box: Add clutter_actor_box_scale function

This allows to scale the box by given factor

https://bugzilla.gnome.org/show_bug.cgi?id=765011
https://gitlab.gnome.org/GNOME/mutter/merge_requests/3
This commit is contained in:
Marco Trevisan (Treviño) 2017-09-01 03:18:52 +02:00 committed by Marco Trevisan
parent ad5555bf42
commit d3beb3ddb7
2 changed files with 25 additions and 0 deletions

View File

@ -594,6 +594,27 @@ _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
box->y1 = box->y2 - height - 3;
}
/**
* clutter_actor_box_scale:
* @box: a #ClutterActorBox
* @scale: scale factor for resizing this box
*
* Rescale the @box by provided @scale factor.
*
* Since: 1.6
*/
void
clutter_actor_box_scale (ClutterActorBox *box,
gfloat scale)
{
g_return_if_fail (box != NULL);
box->x1 *= scale;
box->x2 *= scale;
box->y1 *= scale;
box->y2 *= scale;
}
G_DEFINE_BOXED_TYPE_WITH_CODE (ClutterActorBox, clutter_actor_box,
clutter_actor_box_copy,
clutter_actor_box_free,

View File

@ -560,6 +560,10 @@ void clutter_actor_box_set_size (ClutterActorBox *box,
gfloat width,
gfloat height);
CLUTTER_EXPORT
void clutter_actor_box_scale (ClutterActorBox *box,
gfloat scale);
/**
* ClutterGeometry:
* @x: X coordinate of the top left corner of an actor