[layout] Skip invisible children in FlowLayout
authorEmmanuele Bassi <ebassi@gnome.org>
Wed, 7 Oct 2009 10:39:18 +0000 (11:39 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Wed, 14 Oct 2009 10:31:30 +0000 (11:31 +0100)
Skip hidden actors when computing the preferred size and when
allocating.

clutter/clutter-flow-layout.c

index 44e14f4..289e6f8 100644 (file)
@@ -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)