summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2012-07-06 11:46:25 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2012-07-11 13:22:19 +0100
commitcaf199c7321352b3f97473f9b44c868106e1a405 (patch)
tree4dcfa2e9d7010a84b6828f9be426eb04a3551a3e /examples
parenta758cf6d3d9caadb17ab9594e98c05488e422118 (diff)
downloadclutter-caf199c7321352b3f97473f9b44c868106e1a405.tar.gz
examples: Use rotation angle and pivot point
Instead of the full set_rotation() setter, we can use the pivot point and set the rotation angle separately.
Diffstat (limited to 'examples')
-rw-r--r--examples/basic-actor.c7
-rw-r--r--examples/rounded-rectangle.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/examples/basic-actor.c b/examples/basic-actor.c
index 2e29bad15..f1e37ca32 100644
--- a/examples/basic-actor.c
+++ b/examples/basic-actor.c
@@ -56,8 +56,7 @@ on_transition_stopped (ClutterTransition *transition,
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 250);
- clutter_actor_set_rotation (actor, CLUTTER_Y_AXIS, 0.0f,
- SIZE / 2.0f, 0.f, 0.f);
+ clutter_actor_set_rotation_angle (actor, CLUTTER_Y_AXIS, 0.0f);
clutter_actor_restore_easing_state (actor);
}
@@ -71,8 +70,7 @@ animate_rotation (ClutterActor *actor,
clutter_actor_save_easing_state (actor);
clutter_actor_set_easing_duration (actor, 1000);
- clutter_actor_set_rotation (actor, CLUTTER_Y_AXIS, 360.0,
- SIZE / 2.0f, 0.f, 0.f);
+ clutter_actor_set_rotation_angle (actor, CLUTTER_Y_AXIS, 360.0);
transition = clutter_actor_get_transition (actor, "rotation-angle-y");
g_signal_connect (transition, "stopped",
@@ -140,6 +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_reactive (flowers[2], TRUE);
clutter_actor_add_child (vase, flowers[2]);
g_signal_connect (flowers[2], "button-press-event",
diff --git a/examples/rounded-rectangle.c b/examples/rounded-rectangle.c
index 3858dd429..f1c0c2360 100644
--- a/examples/rounded-rectangle.c
+++ b/examples/rounded-rectangle.c
@@ -74,7 +74,7 @@ main (int argc, char *argv[])
clutter_actor_set_content_scaling_filters (actor,
CLUTTER_SCALING_FILTER_TRILINEAR,
CLUTTER_SCALING_FILTER_LINEAR);
- clutter_actor_set_rotation (actor, CLUTTER_Y_AXIS, 0.0, 250.f, 0.f, 0.f);
+ clutter_actor_set_pivot_point (actor, 0.5f, 0.5f);
clutter_actor_add_constraint (actor, clutter_bind_constraint_new (stage, CLUTTER_BIND_SIZE, 0.f));
clutter_actor_add_child (stage, actor);