[clutter] actor: Only care about a child's paint volume when clip_to_allocation isn't set



commit 8512dd2336f6583e52cbc46d0133ab47dd75b30a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 13 12:43:08 2012 -0500

    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 |   67 ++++++++++++++++++++++++----------------------
 1 files changed, 35 insertions(+), 32 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index df495fb..61ec219 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;
+      if (priv->has_clip &&
+          priv->clip.width >= 0 &&
+          priv->clip.height >= 0)
+        {
+          ClutterVertex origin;
 
-      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);
+          origin.x = priv->clip.x;
+          origin.y = priv->clip.y;
+          origin.z = 0;
 
-      res = TRUE;
-    }
+          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);
 
-  /* if we don't have children we just bail out here... */
-  if (priv->n_children == 0)
-    return res;
+          res = TRUE;
+        }
 
-  /* ...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;
+      /* if we don't have children we just bail out here... */
+      if (priv->n_children == 0)
+        return res;
 
-      child_volume = clutter_actor_get_transformed_paint_volume (child, self);
-      if (child_volume == NULL)
+      /* ...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)
         {
-          res = FALSE;
-          break;
-        }
+          const ClutterPaintVolume *child_volume;
 
-      clutter_paint_volume_union (volume, child_volume);
-      res = TRUE;
+          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;



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