examples: Use pivot point, not anchor point

https://bugzilla.gnome.org/show_bug.cgi?id=677853
This commit is contained in:
Emmanuele Bassi 2012-07-06 18:06:33 +01:00
parent 8cea162d3c
commit 20d1d24e38
4 changed files with 5 additions and 4 deletions

View File

@ -138,7 +138,7 @@ main (int argc, char *argv[])
clutter_actor_set_size (flowers[2], SIZE, SIZE); clutter_actor_set_size (flowers[2], SIZE, SIZE);
clutter_actor_set_margin_right (flowers[2], 12); clutter_actor_set_margin_right (flowers[2], 12);
clutter_actor_set_background_color (flowers[2], CLUTTER_COLOR_Green); 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_set_reactive (flowers[2], TRUE);
clutter_actor_add_child (vase, flowers[2]); clutter_actor_add_child (vase, flowers[2]);
g_signal_connect (flowers[2], "button-press-event", g_signal_connect (flowers[2], "button-press-event",

View File

@ -190,7 +190,7 @@ main (int argc, char *argv[])
*/ */
box = clutter_actor_new (); box = clutter_actor_new ();
clutter_actor_set_layout_manager (box, layout); 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_position (box, 320, 240);
clutter_actor_set_reactive (box, TRUE); clutter_actor_set_reactive (box, TRUE);
clutter_actor_set_name (box, "box"); clutter_actor_set_name (box, "box");

View File

@ -158,7 +158,8 @@ make_bouncer (gfloat width,
clutter_actor_set_name (retval, "bouncer"); clutter_actor_set_name (retval, "bouncer");
clutter_actor_set_size (retval, width, height); 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_reactive (retval, TRUE);
clutter_actor_set_content (retval, canvas); clutter_actor_set_content (retval, canvas);

View File

@ -256,7 +256,7 @@ main (int argc, char *argv[])
clutter_actor_set_background_color (rect, CLUTTER_COLOR_LightScarletRed); clutter_actor_set_background_color (rect, CLUTTER_COLOR_LightScarletRed);
clutter_actor_set_position (rect, 75, 150); clutter_actor_set_position (rect, 75, 150);
clutter_actor_set_size (rect, 50, 50); 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_set_opacity (rect, 224);
clutter_actor_add_child (stage, rect); clutter_actor_add_child (stage, rect);