[mutter] clutter/actor-box: Add clutter_actor_box_scale function



commit d3beb3ddb76fe1b8129a2eb2e8b58acafc821f9d
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Fri Sep 1 03:18:52 2017 +0200

    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

 clutter/clutter/clutter-actor-box.c | 21 +++++++++++++++++++++
 clutter/clutter/clutter-types.h     |  4 ++++
 2 files changed, 25 insertions(+)
---
diff --git a/clutter/clutter/clutter-actor-box.c b/clutter/clutter/clutter-actor-box.c
index 8be2f377e..6871274c5 100644
--- a/clutter/clutter/clutter-actor-box.c
+++ b/clutter/clutter/clutter-actor-box.c
@@ -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,
diff --git a/clutter/clutter/clutter-types.h b/clutter/clutter/clutter-types.h
index e0bffe616..74582ec26 100644
--- a/clutter/clutter/clutter-types.h
+++ b/clutter/clutter/clutter-types.h
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]