[clutter/wip/master-next: 12/23] examples: Use the pivot point for scaling



commit 7ae752698abe055c93c41b690062ccfd4c2b9ce0
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jul 6 12:14:20 2012 +0100

    examples: Use the pivot point for scaling
    
    Instead of scaling with gravity.

 examples/layout-manager.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/examples/layout-manager.c b/examples/layout-manager.c
index 347a96a..1ad4042 100644
--- a/examples/layout-manager.c
+++ b/examples/layout-manager.c
@@ -338,8 +338,7 @@ on_enter (ClutterActor *rect,
           ClutterEvent *event)
 {
   clutter_actor_save_easing_state (rect);
-  clutter_actor_set_scale_with_gravity (rect, 1.2, 1.2,
-                                        CLUTTER_GRAVITY_CENTER);
+  clutter_actor_set_scale (rect, 1.2, 1.2);
   clutter_actor_restore_easing_state (rect);
 
   return CLUTTER_EVENT_STOP;
@@ -350,8 +349,7 @@ on_leave (ClutterActor *rect,
           ClutterEvent *event)
 {
   clutter_actor_save_easing_state (rect);
-  clutter_actor_set_scale_with_gravity (rect, 1.0, 1.0,
-                                        CLUTTER_GRAVITY_CENTER);
+  clutter_actor_set_scale (rect, 1.0, 1.0);
   clutter_actor_restore_easing_state (rect);
 
   return CLUTTER_EVENT_STOP;
@@ -430,6 +428,7 @@ main (int argc, char *argv[])
       color.alpha = 128 + 128 / N_RECTS * i;
 
       clutter_actor_set_size (rect, RECT_SIZE, RECT_SIZE);
+      clutter_actor_set_pivot_point (rect, .5f, .5f);
       clutter_actor_set_background_color (rect, &color);
       clutter_actor_set_reactive (rect, TRUE);
       clutter_actor_add_child (box, rect);



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