From 4ea57bc685abeea9273b2b8427a9199980cc2f40 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 7 Oct 2009 11:39:18 +0100 Subject: [PATCH] [layout] Skip invisible children in FlowLayout Skip hidden actors when computing the preferred size and when allocating. --- clutter/clutter-flow-layout.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clutter/clutter-flow-layout.c b/clutter/clutter-flow-layout.c index 44e14f418..289e6f840 100644 --- a/clutter/clutter-flow-layout.c +++ b/clutter/clutter-flow-layout.c @@ -118,6 +118,9 @@ clutter_flow_layout_get_preferred_width (ClutterLayoutManager *manager, ClutterActor *child = l->data; gfloat child_min, child_natural; + if (!CLUTTER_ACTOR_IS_VISIBLE (child)) + continue; + clutter_actor_get_preferred_width (child, for_height, &child_min, &child_natural); @@ -172,6 +175,9 @@ clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager, ClutterActor *child = l->data; gfloat child_min, child_natural; + if (!CLUTTER_ACTOR_IS_VISIBLE (child)) + continue; + clutter_actor_get_preferred_height (child, for_width, &child_min, &child_natural); @@ -263,6 +269,9 @@ clutter_flow_layout_allocate (ClutterLayoutManager *manager, gfloat item_width, item_height; gfloat child_min, child_natural; + if (!CLUTTER_ACTOR_IS_VISIBLE (child)) + continue; + if (line_items_count == items_per_line) { if (priv->orientation == CLUTTER_FLOW_HORIZONTAL)