From bb6751b84b132e5a7d5692275be884ee1659152c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 13 Nov 2008 10:54:06 +0000 Subject: [PATCH] 2008-11-13 Emmanuele Bassi * clutter/clutter-behaviour-ellipse.c: (clutter_behaviour_ellipse_applied): Do not reset the depth of the actors to which the Ellipse behaviour has been applied to, unless the behaviour is going to update it because it has a tilt on the X or Y axis. --- ChangeLog | 8 ++++++++ clutter/clutter-behaviour-ellipse.c | 21 ++++++++++----------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 972d33cb2..6108028e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-11-13 Emmanuele Bassi + + * clutter/clutter-behaviour-ellipse.c: + (clutter_behaviour_ellipse_applied): Do not reset the depth + of the actors to which the Ellipse behaviour has been applied + to, unless the behaviour is going to update it because it has + a tilt on the X or Y axis. + 2008-11-13 Neil Roberts * clutter/clutter-actor.c (clutter_actor_get_reactive) diff --git a/clutter/clutter-behaviour-ellipse.c b/clutter/clutter-behaviour-ellipse.c index 5a6078776..a24cd3c97 100644 --- a/clutter/clutter-behaviour-ellipse.c +++ b/clutter/clutter-behaviour-ellipse.c @@ -32,8 +32,9 @@ * #ClutterBehaviourEllipse interpolates actors along a path defined by * an ellipse. * - * Note, on applying an ellipse behaviour to an actor its position will - * be set to what is dictated by the ellipses initial position. + * When applying an ellipse behaviour to an actor, the + * behaviour will update the actor's position and depth and set them + * to what is dictated by the ellipses initial position. * * Since: 0.4 */ @@ -339,20 +340,18 @@ clutter_behaviour_ellipse_applied (ClutterBehaviour *behave, ClutterActor *actor) { ClutterBehaviourEllipse *e = CLUTTER_BEHAVIOUR_ELLIPSE (behave); - knot3d knot; + ClutterBehaviourEllipsePrivate *priv = e->priv;; + knot3d knot = { 0, }; - clutter_behaviour_ellipse_advance (e, e->priv->angle_start, &knot); + clutter_behaviour_ellipse_advance (e, priv->angle_start, &knot); clutter_actor_set_position (actor, knot.x, knot.y); - clutter_actor_set_depth (actor, knot.z); -#if 0 - /* no need to chain up: ClutterBehaviourEllipse's parent class does - * not have a class closure for ::apply + /* the depth should be changed only if there is a tilt on + * any of the X or the Y axis */ - if (CLUTTER_BEHAVIOUR_CLASS (clutter_behaviour_ellipse_parent_class)->apply) - CLUTTER_BEHAVIOUR_CLASS (clutter_behaviour_ellipse_parent_class)->apply (behave, actor); -#endif + if (priv->angle_tilt_x != 0 || priv->angle_tilt_y != 0) + clutter_actor_set_depth (actor, knot.z); } static void