[animation] Force the final state inside ::completed

In case we are skipping too many frames, we should force the animation
instance to apply the final state of the animated interval inside the
::completed signal handler.
This commit is contained in:
Emmanuele Bassi 2009-07-28 11:25:11 +01:00
parent a8eb5bd461
commit fa3728126f

View File

@ -132,12 +132,28 @@ clutter_animation_real_completed (ClutterAnimation *self)
{ {
ClutterAnimationPrivate *priv = self->priv; ClutterAnimationPrivate *priv = self->priv;
ClutterAnimation *animation; ClutterAnimation *animation;
gpointer key, value;
GHashTableIter iter;
/* 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))
{
const gchar *p_name = key;
ClutterInterval *interval = value;
GValue *p_value;
value = clutter_interval_peek_final_value (interval);
g_object_set_property (priv->object, p_name, value);
}
/* at this point, if this animation was created by clutter_actor_animate() /* at this point, if this animation was created by clutter_actor_animate()
* and friends, the animation will be attached to the object's data; since * and friends, the animation will be attached to the object's data; since
* we want to allow developers to use g_signal_connect_after("completed") * we want to allow developers to use g_signal_connect_after("completed")
* to concatenate a new animation, we need to remove the animation back * to concatenate a new animation, we need to remove the animation back
* pointer here, and unref() the animation * pointer here, and unref() the animation. FIXME - we might want to
* provide a clutter_animation_attach()/clutter_animation_detach() pair
* to let the user reattach an animation
*/ */
animation = g_object_get_qdata (priv->object, quark_object_animation); animation = g_object_get_qdata (priv->object, quark_object_animation);
if (animation == self) if (animation == self)