Skip to content

Commit c403b45

Browse files
committed
comments
1 parent c405a3b commit c403b45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/textual/_layout.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ def arrange(
4646
"""
4747

4848
def get_content_width(self, widget: Widget, container: Size, viewport: Size) -> int:
49-
"""Get the width of the content. In Horizontal layout, the content width of
50-
a widget is the sum of the widths of its children.
49+
"""Get the optimal content width by arranging children.
5150
5251
Args:
5352
widget (Widget): The container widget.
@@ -60,6 +59,7 @@ def get_content_width(self, widget: Widget, container: Size, viewport: Size) ->
6059
if not widget.children:
6160
width = 0
6261
else:
62+
# Use a size of 0, 0 to ignore relative sizes, since those are flexible anyway
6363
placements, _, _ = widget._arrange(Size(0, 0))
6464
width = max(
6565
[
@@ -87,6 +87,7 @@ def get_content_height(
8787
if not widget.children:
8888
height = 0
8989
else:
90+
# Use a height of zero to ignore relative heights
9091
placements, _, _ = widget._arrange(Size(width, 0))
9192
height = max(
9293
[

0 commit comments

Comments
 (0)