mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
[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:
parent
a8eb5bd461
commit
fa3728126f
@ -132,12 +132,28 @@ clutter_animation_real_completed (ClutterAnimation *self)
|
||||
{
|
||||
ClutterAnimationPrivate *priv = self->priv;
|
||||
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()
|
||||
* 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")
|
||||
* 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);
|
||||
if (animation == self)
|
||||
|
Loading…
Reference in New Issue
Block a user