From 8512dd2336f6583e52cbc46d0133ab47dd75b30a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 13 Feb 2012 12:43:08 -0500 Subject: [PATCH] actor: Only care about a child's paint volume when clip_to_allocation isn't set If we're clipping to the allocation, then the child can paint wherever it wants, and we don't care. The paint volume is the allocation here. --- clutter/clutter-actor.c | 75 +++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index df495fb2c..61ec21980 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -4705,46 +4705,49 @@ clutter_actor_real_get_paint_volume (ClutterActor *self, */ res = TRUE; } - else if (priv->has_clip && - priv->clip.width >= 0 && - priv->clip.height >= 0) + else { - ClutterVertex origin; - - origin.x = priv->clip.x; - origin.y = priv->clip.y; - origin.z = 0; - - clutter_paint_volume_set_origin (volume, &origin); - clutter_paint_volume_set_width (volume, priv->clip.width); - clutter_paint_volume_set_height (volume, priv->clip.height); - - res = TRUE; - } - - /* if we don't have children we just bail out here... */ - if (priv->n_children == 0) - return res; - - /* ...but if we have children then we ask for their paint volume in - * our coordinates. if any of our children replies that it doesn't - * have a paint volume, we bail out - */ - for (child = priv->first_child; - child != NULL; - child = child->priv->next_sibling) - { - const ClutterPaintVolume *child_volume; - - child_volume = clutter_actor_get_transformed_paint_volume (child, self); - if (child_volume == NULL) + if (priv->has_clip && + priv->clip.width >= 0 && + priv->clip.height >= 0) { - res = FALSE; - break; + ClutterVertex origin; + + origin.x = priv->clip.x; + origin.y = priv->clip.y; + origin.z = 0; + + clutter_paint_volume_set_origin (volume, &origin); + clutter_paint_volume_set_width (volume, priv->clip.width); + clutter_paint_volume_set_height (volume, priv->clip.height); + + res = TRUE; } - clutter_paint_volume_union (volume, child_volume); - res = TRUE; + /* if we don't have children we just bail out here... */ + if (priv->n_children == 0) + return res; + + /* ...but if we have children then we ask for their paint volume in + * our coordinates. if any of our children replies that it doesn't + * have a paint volume, we bail out + */ + for (child = priv->first_child; + child != NULL; + child = child->priv->next_sibling) + { + const ClutterPaintVolume *child_volume; + + child_volume = clutter_actor_get_transformed_paint_volume (child, self); + if (child_volume == NULL) + { + res = FALSE; + break; + } + + clutter_paint_volume_union (volume, child_volume); + res = TRUE; + } } return res;