[clutter/wip/master-next: 17/23] examples: Use pivot point, not anchor point



commit 3d19ab1edf710d002efbbfe1178e327a90011854
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Fri Jul 6 18:06:33 2012 +0100

    examples: Use pivot point, not anchor point

 examples/basic-actor.c  |    2 +-
 examples/bin-layout.c   |    2 +-
 examples/easing-modes.c |    3 ++-
 examples/threads.c      |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/examples/basic-actor.c b/examples/basic-actor.c
index f1e37ca..0ce3967 100644
--- a/examples/basic-actor.c
+++ b/examples/basic-actor.c
@@ -138,7 +138,7 @@ main (int argc, char *argv[])
   clutter_actor_set_size (flowers[2], SIZE, SIZE);
   clutter_actor_set_margin_right (flowers[2], 12);
   clutter_actor_set_background_color (flowers[2], CLUTTER_COLOR_Green);
-  clutter_actor_set_pivot_point (flowers[2], 0.5, 0.5);
+  clutter_actor_set_pivot_point (flowers[2], 0.5f, 0.0f);
   clutter_actor_set_reactive (flowers[2], TRUE);
   clutter_actor_add_child (vase, flowers[2]);
   g_signal_connect (flowers[2], "button-press-event",
diff --git a/examples/bin-layout.c b/examples/bin-layout.c
index 048f3b4..7dc9b96 100644
--- a/examples/bin-layout.c
+++ b/examples/bin-layout.c
@@ -190,7 +190,7 @@ main (int argc, char *argv[])
    */
   box = clutter_actor_new ();
   clutter_actor_set_layout_manager (box, layout);
-  clutter_actor_set_anchor_point_from_gravity (box, CLUTTER_GRAVITY_CENTER);
+  clutter_actor_add_constraint (box, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5));
   clutter_actor_set_position (box, 320, 240);
   clutter_actor_set_reactive (box, TRUE);
   clutter_actor_set_name (box, "box");
diff --git a/examples/easing-modes.c b/examples/easing-modes.c
index 5393e72..2a2e233 100644
--- a/examples/easing-modes.c
+++ b/examples/easing-modes.c
@@ -158,7 +158,8 @@ make_bouncer (gfloat width,
 
   clutter_actor_set_name (retval, "bouncer");
   clutter_actor_set_size (retval, width, height);
-  clutter_actor_set_anchor_point (retval, width / 2, height / 2);
+  clutter_actor_set_pivot_point (retval, 0.5f, 0.5f);
+  clutter_actor_set_translation (retval, width / -2.f, height / -2.f, 0.f);
   clutter_actor_set_reactive (retval, TRUE);
   clutter_actor_set_content (retval, canvas);
 
diff --git a/examples/threads.c b/examples/threads.c
index 59abb80..7a1e71e 100644
--- a/examples/threads.c
+++ b/examples/threads.c
@@ -256,7 +256,7 @@ main (int argc, char *argv[])
   clutter_actor_set_background_color (rect, CLUTTER_COLOR_LightScarletRed);
   clutter_actor_set_position (rect, 75, 150);
   clutter_actor_set_size (rect, 50, 50);
-  clutter_actor_set_anchor_point (rect, 25, 25);
+  clutter_actor_set_pivot_point (rect, .5f, .5f);
   clutter_actor_set_opacity (rect, 224);
   clutter_actor_add_child (stage, rect);
 



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