From cede56dcdda0bfdd26a155452d05d20e6c974732 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 28 Mar 2012 16:39:30 +0100 Subject: [PATCH] actor: Ensure we use the current easing duration and mode When updating a transition in flight, if the current easing state does not match the transition's. --- clutter/clutter-actor.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 7787cfbdf..e450c7add 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -17068,14 +17068,27 @@ _clutter_actor_update_transition (ClutterActor *actor, /* if we're updating with an easing duration of zero milliseconds, * we just jump the timeline to the end and let it run its course */ - if (info->cur_state == NULL || info->cur_state->easing_duration == 0) + if (info->cur_state != NULL && + info->cur_state->easing_duration != 0) + { + guint cur_duration = clutter_timeline_get_duration (timeline); + ClutterAnimationMode cur_mode = + clutter_timeline_get_progress_mode (timeline); + + if (cur_duration != info->cur_state->easing_duration) + clutter_timeline_set_duration (timeline, info->cur_state->easing_duration); + + if (cur_mode != info->cur_state->easing_mode) + clutter_timeline_set_progress_mode (timeline, info->cur_state->easing_mode); + + clutter_timeline_rewind (timeline); + } + else { guint duration = clutter_timeline_get_duration (timeline); clutter_timeline_advance (timeline, duration); } - else - clutter_timeline_rewind (timeline); out: g_value_unset (&initial);