From e4089efb4c36abe2c743eefef0c960cb9453ae85 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Wed, 5 May 2010 16:55:16 +0100 Subject: [PATCH] animator: only keys that are removed due to actors disappearing are inert --- clutter/clutter-animator.c | 58 ++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/clutter/clutter-animator.c b/clutter/clutter-animator.c index 36cfca7..4a596ad 100644 --- a/clutter/clutter-animator.c +++ b/clutter/clutter-animator.c @@ -354,12 +354,19 @@ sort_actor_prop_func (gconstpointer a, return pa->object - pb->object; } +static void +clutter_animator_remove_key_internal (ClutterAnimator *animator, + GObject *object, + const gchar *property_name, + gdouble progress, + gboolean is_inert); static void object_disappeared (gpointer data, GObject *where_the_object_was) { - clutter_animator_remove_key (data, where_the_object_was, NULL, -1.0); + clutter_animator_remove_key_internal (data, where_the_object_was, NULL, -1.0, + TRUE); } static ClutterAnimatorKey * @@ -1380,24 +1387,12 @@ clutter_animator_get_keys (ClutterAnimator *animator, return g_list_reverse (keys); } -/** - * clutter_animator_remove_key: - * @animator: a #ClutterAnimator - * @object: (allow-none): a #GObject to search for, or %NULL for all - * @property_name: (allow-none): a specific property name to query for, - * or %NULL for all - * @progress: a specific progress to search for or a negative value - * for all - * - * Removes all keys matching the conditions specificed in the arguments. - * - * Since: 1.2 - */ -void -clutter_animator_remove_key (ClutterAnimator *animator, - GObject *object, - const gchar *property_name, - gdouble progress) +static void +clutter_animator_remove_key_internal (ClutterAnimator *animator, + GObject *object, + const gchar *property_name, + gdouble progress, + gboolean is_inert) { ClutterAnimatorPrivate *priv; GList *k; @@ -1419,7 +1414,7 @@ clutter_animator_remove_key (ClutterAnimator *animator, ) { ClutterAnimatorKey *prev_key = NULL; - key->is_inert = TRUE; + key->is_inert = is_inert; clutter_animator_key_free (key); @@ -1465,6 +1460,29 @@ again: } } +/** + * clutter_animator_remove_key: + * @animator: a #ClutterAnimator + * @object: (allow-none): a #GObject to search for, or %NULL for all + * @property_name: (allow-none): a specific property name to query for, + * or %NULL for all + * @progress: a specific progress to search for or a negative value + * for all + * + * Removes all keys matching the conditions specificed in the arguments. + * + * Since: 1.2 + */ +void +clutter_animator_remove_key (ClutterAnimator *animator, + GObject *object, + const gchar *property_name, + gdouble progress) +{ + clutter_animator_remove_key_internal (animator, object, property_name, + progress, FALSE); +} + -- 2.7.4