From 3761e9cd47950bfade7d3b829b20b245806632a2 Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Wed, 19 Aug 2009 13:14:10 +0000 Subject: [PATCH] Check timeline direction when forcing final state If the timeline is running backwards, the completed signal handler should set the final state from the interval's initial value. Signed-off-by: Emmanuele Bassi --- clutter/clutter-animation.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-animation.c b/clutter/clutter-animation.c index f007b7ac0..dd01dee76 100644 --- a/clutter/clutter-animation.c +++ b/clutter/clutter-animation.c @@ -132,9 +132,14 @@ clutter_animation_real_completed (ClutterAnimation *self) { ClutterAnimationPrivate *priv = self->priv; ClutterAnimation *animation; + ClutterTimeline *timeline; + ClutterTimelineDirection direction; gpointer key, value; GHashTableIter iter; + timeline = clutter_animation_get_timeline (self); + direction = clutter_timeline_get_direction (timeline); + /* explicitly set the final state of the animation */ g_hash_table_iter_init (&iter, priv->properties); while (g_hash_table_iter_next (&iter, &key, &value)) @@ -143,7 +148,11 @@ clutter_animation_real_completed (ClutterAnimation *self) ClutterInterval *interval = value; GValue *p_value; - p_value = clutter_interval_peek_final_value (interval); + if (direction == CLUTTER_TIMELINE_FORWARD) + p_value = clutter_interval_peek_final_value (interval); + else + p_value = clutter_interval_peek_initial_value (interval); + g_object_set_property (priv->object, p_name, p_value); }