animator: fix removal of all keys

When removing all keys in a ClutterAnimator, the hash table with
object/property name pairs went out of sync. This change makes
the animator always clear this hash table upon key-removal; and
refreshing it if the animator's timeline is running.

Fixes bug #2335
This commit is contained in:
Øyvind Kolås 2010-09-24 13:28:08 +01:00
parent f834b8b138
commit 4640dad6af

View File

@ -1445,23 +1445,14 @@ again:
} }
} }
if (object) /* clear off cached state for all properties, this is regenerated in a
{ * correct state by animation_animator_started
GHashTableIter iter; */
gpointer key, value; g_hash_table_remove_all (priv->properties);
again2: /* if the animator is already running reinitialize internal iterators */
g_hash_table_iter_init (&iter, priv->properties); if (clutter_timeline_is_playing (priv->timeline))
while (g_hash_table_iter_next (&iter, &key, &value)) animation_animator_started (priv->timeline, animator);
{
PropObjectKey *prop_actor_key = key;
if (prop_actor_key->object == object)
{
g_hash_table_remove (priv->properties, key);
goto again2;
}
}
}
} }
/** /**