@@ -315,7 +315,9 @@ def _update_size_hints(self):
315
315
self ._size_hint_requires_update = False
316
316
317
317
required_space_between = max (0 , len (self .children ) - 1 ) * self ._space_between
318
- min_child_sizes = [UILayout .min_size_of (child ) for child in self .children ]
318
+ min_child_sizes = [
319
+ UILayout .min_size_of (child ) for child in self .children if child .visible is not None
320
+ ]
319
321
320
322
if len (self .children ) == 0 :
321
323
width = 0
@@ -360,10 +362,14 @@ def do_layout(self):
360
362
if not self .children :
361
363
return
362
364
365
+ children_to_render = [
366
+ (child , data ) for child , data in self ._children if child .visible is not None
367
+ ]
368
+
363
369
# main axis
364
370
constraints = [
365
371
_C .from_widget_height (child ) if self .vertical else _C .from_widget_width (child )
366
- for child , _ in self . _children
372
+ for child , _ in children_to_render
367
373
]
368
374
369
375
available_space = (
@@ -374,14 +380,14 @@ def do_layout(self):
374
380
# orthogonal axis
375
381
constraints = [
376
382
_C .from_widget_width (child ) if self .vertical else _C .from_widget_height (child )
377
- for child , _ in self . _children
383
+ for child , _ in children_to_render
378
384
]
379
385
orthogonal_sizes = _box_orthogonal_algorithm (
380
386
constraints , self .content_width if self .vertical else self .content_height
381
387
)
382
388
383
389
for (child , data ), main_size , ortho_size in zip (
384
- self . _children , main_sizes , orthogonal_sizes
390
+ children_to_render , main_sizes , orthogonal_sizes
385
391
):
386
392
# apply calculated sizes, condition regarding existing size_hint
387
393
# are already covered in calculation input
0 commit comments