Skip to content

Commit f95c056

Browse files
committed
correct docstrings
1 parent e875e4c commit f95c056

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/textual/content.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,15 @@ def get_optimal_width(
371371
rules: RulesMap,
372372
container_width: int,
373373
) -> int:
374-
"""Get optimal width of the visual to display its content. Part of the Textual Visual protocol.
374+
"""Get optimal width of the Visual to display its content.
375+
376+
The exact definition of "optimal width" is dependant on the Visual, but
377+
will typically be wide enough to display output without cropping or wrapping,
378+
and without superfluous space.
375379
376380
Args:
377-
widget: Parent widget.
378-
container_size: The size of the container.
381+
rules: A mapping of style rules, such as the Widgets `styles` object.
382+
container_width: The size of the container in cells.
379383
380384
Returns:
381385
A width in cells.
@@ -385,11 +389,11 @@ def get_optimal_width(
385389
return max(line.cell_length for line in lines)
386390

387391
def get_height(self, rules: RulesMap, width: int) -> int:
388-
"""Get the height of the visual if rendered with the given width. Part of the Textual Visual protocol.
392+
"""Get the height of the Visual if rendered at the given width.
389393
390394
Args:
391-
widget: Parent widget.
392-
width: Width of visual.
395+
rules: A mapping of style rules, such as the Widgets `styles` object.
396+
width: Width of visual in cells.
393397
394398
Returns:
395399
A height in lines.

0 commit comments

Comments
 (0)