mirror of
https://github.com/brl/mutter.git
synced 2024-12-24 20:12:06 +00:00
interactive/actor: Do not use clutter_actor_animate()
Use implicit animations instead.
This commit is contained in:
parent
cb8dea0379
commit
389ee45747
@ -16,9 +16,11 @@ animate_color (ClutterActor *actor,
|
|||||||
else
|
else
|
||||||
end_color = CLUTTER_COLOR_Red;
|
end_color = CLUTTER_COLOR_Red;
|
||||||
|
|
||||||
clutter_actor_animate (actor, CLUTTER_LINEAR, 500,
|
clutter_actor_save_easing_state (actor);
|
||||||
"background-color", end_color,
|
clutter_actor_set_easing_duration (actor, 500);
|
||||||
NULL);
|
clutter_actor_set_easing_mode (actor, CLUTTER_LINEAR);
|
||||||
|
clutter_actor_set_background_color (actor, end_color);
|
||||||
|
clutter_actor_restore_easing_state (actor);
|
||||||
|
|
||||||
toggled = !toggled;
|
toggled = !toggled;
|
||||||
|
|
||||||
@ -38,41 +40,46 @@ on_crossing (ClutterActor *actor,
|
|||||||
else
|
else
|
||||||
depth = 0.0;
|
depth = 0.0;
|
||||||
|
|
||||||
clutter_actor_animate (actor, CLUTTER_EASE_OUT_BOUNCE, 500,
|
clutter_actor_save_easing_state (actor);
|
||||||
"depth", depth,
|
clutter_actor_set_easing_duration (actor, 500);
|
||||||
NULL);
|
clutter_actor_set_easing_mode (actor, CLUTTER_EASE_OUT_BOUNCE);
|
||||||
|
clutter_actor_set_depth (actor, depth);
|
||||||
|
clutter_actor_restore_easing_state (actor);
|
||||||
|
|
||||||
return CLUTTER_EVENT_STOP;
|
return CLUTTER_EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
restore_actor (ClutterActor *actor)
|
on_transition_complete (ClutterTransition *transition,
|
||||||
|
ClutterActor *actor)
|
||||||
{
|
{
|
||||||
clutter_actor_set_rotation (actor, CLUTTER_Y_AXIS, 0.0,
|
clutter_actor_save_easing_state (actor);
|
||||||
SIZE / 2.0,
|
clutter_actor_set_easing_duration (actor, 250);
|
||||||
0.f,
|
|
||||||
0.f);
|
clutter_actor_set_rotation (actor, CLUTTER_Y_AXIS, 0.0f,
|
||||||
clutter_actor_set_reactive (actor, TRUE);
|
SIZE / 2.0f, 0.f, 0.f);
|
||||||
|
|
||||||
|
clutter_actor_restore_easing_state (actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
animate_rotation (ClutterActor *actor,
|
animate_rotation (ClutterActor *actor,
|
||||||
ClutterEvent *event)
|
ClutterEvent *event)
|
||||||
{
|
{
|
||||||
ClutterVertex center;
|
ClutterTransition *transition;
|
||||||
|
|
||||||
center.x = SIZE / 2.0;
|
clutter_actor_save_easing_state (actor);
|
||||||
center.y = 0.f;
|
clutter_actor_set_easing_duration (actor, 1000);
|
||||||
center.z = 0.f;
|
|
||||||
|
|
||||||
clutter_actor_animate (actor, CLUTTER_EASE_OUT_EXPO, 500,
|
clutter_actor_set_rotation (actor, CLUTTER_Y_AXIS, 360.0,
|
||||||
"fixed::reactive", FALSE,
|
SIZE / 2.0f, 0.f, 0.f);
|
||||||
"fixed::rotation-center-y", ¢er,
|
|
||||||
"rotation-angle-y", 360.0,
|
transition = clutter_actor_get_transition (actor, "rotation-angle-y");
|
||||||
"signal-swapped-after::completed",
|
g_signal_connect (transition, "completed",
|
||||||
G_CALLBACK (restore_actor),
|
G_CALLBACK (on_transition_complete),
|
||||||
actor,
|
actor);
|
||||||
NULL);
|
|
||||||
|
clutter_actor_restore_easing_state (actor);
|
||||||
|
|
||||||
return CLUTTER_EVENT_STOP;
|
return CLUTTER_EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user