mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
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:
parent
ad5555bf42
commit
d3beb3ddb7
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user