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 <ebassi@linux.intel.com>
This commit is contained in:
Jonas Bonn 2009-08-19 13:14:10 +00:00 committed by Emmanuele Bassi
parent 373b165b3f
commit 3761e9cd47

View File

@ -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;
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);
}