[clutter] actor: Remove existing implicit transition if duration is 0



commit 03f4f1c69e7c66702cbed7e158a36668ae3683b9
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Sep 3 12:59:30 2012 +0100

    actor: Remove existing implicit transition if duration is 0
    
    When changing an implicit transition mid flight we may end up with an
    easing state with a duration of zero milliseconds; this leads to the
    implicit transition machinery setting the final state directly onto the
    actor. If there is a running transition, though, we need to remove it
    from the transitions table, otherwise it will keep running.
    
    This regression happened when the update_transition() internal function
    was merged into the create_transition() one.
    
    Tested-by: Lionel Landwerlin <llandwerlin gmail com>

 clutter/clutter-actor.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 2c40736..e9ead06 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -18624,6 +18624,9 @@ _clutter_actor_create_transition (ClutterActor *actor,
    */
   if (info->cur_state->easing_duration == 0)
     {
+      /* remove a transition, if one exists */
+      clutter_actor_remove_transition (actor, pspec->name);
+
       clutter_actor_set_animatable_property (actor,
                                              pspec->param_id,
                                              &final,
@@ -18784,6 +18787,8 @@ clutter_actor_remove_transition (ClutterActor *self,
     return;
 
   clos = g_hash_table_lookup (info->transitions, name);
+  if (clos == NULL)
+    return;
 
   was_playing =
     clutter_timeline_is_playing (CLUTTER_TIMELINE (clos->transition));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]