Skip to content

Commit 9ec6ae5

Browse files
committed
uneeded layout changes
1 parent 5664b3e commit 9ec6ae5

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

src/textual/layout.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from abc import ABC, abstractmethod
44
from dataclasses import dataclass
5-
from fractions import Fraction
65
from typing import TYPE_CHECKING, ClassVar, Iterable, NamedTuple
76

87
from textual._spatial_map import SpatialMap
@@ -238,16 +237,9 @@ def get_content_width(self, widget: Widget, container: Size, viewport: Size) ->
238237
width = 0
239238
else:
240239
arrangement = widget._arrange(
241-
Size(
242-
(
243-
int(widget._extrema.min_width or 0)
244-
if widget.shrink
245-
else int(widget._extrema.apply_width(Fraction(container.width)))
246-
),
247-
0,
248-
)
240+
Size(0 if widget.shrink else container.width, 0)
249241
)
250-
width = arrangement.total_region.width
242+
width = arrangement.total_region.right
251243
return width
252244

253245
def get_content_height(
@@ -265,22 +257,13 @@ def get_content_height(
265257
Content height (in lines).
266258
"""
267259
if widget._nodes:
268-
height = container.height
269-
270260
if not widget.styles.is_docked and all(
271261
child.styles.is_dynamic_height for child in widget.displayed_children
272262
):
273263
# An exception for containers with all dynamic height widgets
274-
arrangement = widget._arrange(
275-
Size(
276-
width,
277-
int(widget._extrema.apply_height(Fraction(container.height))),
278-
)
279-
)
264+
arrangement = widget._arrange(Size(width, container.height))
280265
else:
281-
arrangement = widget._arrange(
282-
Size(width, int(widget._extrema.min_height or 0))
283-
)
266+
arrangement = widget._arrange(Size(width, 0))
284267
height = arrangement.total_region.height
285268
else:
286269
height = 0

0 commit comments

Comments
 (0)