summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@linux.intel.com>2012-03-28 12:43:57 +0100
committerEmmanuele Bassi <ebassi@linux.intel.com>2012-04-10 09:42:41 +0100
commitb17d56a35d47a2f66a89b133edb31328bd28883e (patch)
tree28c7d1f1e2029f4d892ff58752083c22dea77dc2 /clutter
parent835849c7bbe6dca4831f733bb59962ab53520960 (diff)
downloadclutter-b17d56a35d47a2f66a89b133edb31328bd28883e.tar.gz
actor: Check easing duration when updating in-flight transitions
If we update a transition that is currently playing, we need to check the current easing state, and look at the eventual duration, in case the user wants to cancel the transition.
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter-actor.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 78edfbaba..bac7acb8f 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -16999,6 +16999,7 @@ _clutter_actor_update_transition (ClutterActor *actor,
...)
{
TransitionClosure *clos;
+ ClutterTimeline *timeline;
ClutterInterval *interval;
const ClutterAnimationInfo *info;
va_list var_args;
@@ -17016,6 +17017,8 @@ _clutter_actor_update_transition (ClutterActor *actor,
if (clos == NULL)
return;
+ timeline = CLUTTER_TIMELINE (clos->transition);
+
va_start (var_args, pspec);
ptype = G_PARAM_SPEC_VALUE_TYPE (pspec);
@@ -17037,7 +17040,17 @@ _clutter_actor_update_transition (ClutterActor *actor,
clutter_interval_set_initial_value (interval, &initial);
clutter_interval_set_final_value (interval, &final);
- clutter_timeline_rewind (CLUTTER_TIMELINE (clos->transition));
+ /* 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)
+ {
+ guint duration = clutter_timeline_get_duration (timeline);
+
+ clutter_timeline_advance (timeline, duration);
+ }
+ else
+ clutter_timeline_rewind (timeline);
out:
g_value_unset (&initial);