transition = _clutter_actor_create_transition (self, pspec,
*cur_angle_p,
angle);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, pspec, angle);
transition = _clutter_actor_create_transition (self, pspec,
old_factor,
new_factor);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, pspec, new_factor);
obj_props[PROP_WIDTH],
old_width,
width);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, obj_props[PROP_WIDTH], width);
obj_props[PROP_HEIGHT],
old_height,
height);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, obj_props[PROP_HEIGHT], height);
obj_props[PROP_X],
linfo->fixed_x,
x);
-
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, obj_props[PROP_X], x);
obj_props[PROP_Y],
linfo->fixed_y,
y);
-
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, obj_props[PROP_Y], y);
obj_props[PROP_OPACITY],
priv->opacity,
opacity);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, obj_props[PROP_OPACITY], opacity);
transition = _clutter_actor_create_transition (self, obj_props[PROP_DEPTH],
tinfo->depth,
depth);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, obj_props[PROP_DEPTH], depth);
transition = _clutter_actor_create_transition (self, bg_color_pspec,
&priv->bg_color,
color);
- clutter_timeline_start (CLUTTER_TIMELINE (transition));
}
else
_clutter_actor_update_transition (self, bg_color_pspec, color);
{
TransitionClosure *clos = data;
+ if (clutter_timeline_is_playing (CLUTTER_TIMELINE (clos->transition)))
+ clutter_timeline_stop (CLUTTER_TIMELINE (clos->transition));
+
g_signal_handler_disconnect (clos->transition, clos->completed_id);
+
+ g_object_unref (clos->transition);
g_free (clos->name);
g_slice_free (TransitionClosure, clos);
info = _clutter_actor_get_animation_info (actor);
/* this will take care of cleaning clos for us */
- g_hash_table_remove (info->transitions, clos->name);
+ if (clutter_transition_get_remove_on_complete (transition))
+ {
+ /* we take a reference here because removing the closure
+ * will release the reference on the transition, and we
+ * want the transition to survive the signal emission;
+ * the master clock will release the laste reference at
+ * the end of the frame processing.
+ */
+ g_object_ref (transition);
+ g_hash_table_remove (info->transitions, clos->name);
+ }
/* if it's the last transition then we clean up */
if (g_hash_table_size (info->transitions) == 0)
clutter_transition_set_interval (res, interval);
clutter_transition_set_remove_on_complete (res, TRUE);
+ /* this will start the transition as well */
clutter_actor_add_transition (actor, pspec->name, res);
+
+ /* the actor now owns the transition */
+ g_object_unref (res);
}
else
res = clos->transition;
* associated to the actor's current easing state; it is possible to modify
* these values after calling clutter_actor_add_transition().
*
+ * The @transition will be started once added.
+ *
+ * This function will take a reference on the @transition.
+ *
* This function is usually called implicitly when modifying an animatable
* property.
*
clos = g_slice_new (TransitionClosure);
clos->actor = self;
- clos->transition = transition;
+ clos->transition = g_object_ref (transition);
clos->name = g_strdup (name);
clos->completed_id = g_signal_connect (timeline, "completed",
G_CALLBACK (on_transition_completed),
clos);
g_hash_table_insert (info->transitions, clos->name, clos);
+ clutter_timeline_start (timeline);
}
/**
* Removes the transition stored inside a #ClutterActor using @name
* identifier.
*
+ * If the transition is currently in progress, it will be stopped.
+ *
+ * This function releases the reference acquired when the transition
+ * was added to the #ClutterActor.
+ *
* Since: 1.10
*/
void