Skip to content

Commit 41441df

Browse files
committed
simplify
1 parent f6f695f commit 41441df

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/textual/_resolve.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,10 @@ def resolve_box_models(
197197
List of resolved box models.
198198
"""
199199

200-
margins = [widget.styles.margin for widget in widgets]
201-
202200
margin_width, margin_height = margin
203-
204201
fraction_width = Fraction(size.width)
205202
fraction_height = Fraction(size.height)
206203
fraction_zero = Fraction(0)
207-
208204
margin_size = size - margin
209205

210206
# Fixed box models
@@ -215,11 +211,11 @@ def resolve_box_models(
215211
else widget._get_box_model(
216212
size,
217213
viewport_size,
218-
max(fraction_zero, fraction_width - margin.width),
219-
max(fraction_zero, fraction_height - margin.height),
214+
max(fraction_zero, fraction_width - widget.styles.margin.width),
215+
max(fraction_zero, fraction_height - widget.styles.margin.height),
220216
)
221217
)
222-
for (_dimension, widget, margin) in zip(dimensions, widgets, margins)
218+
for (_dimension, widget) in zip(dimensions, widgets)
223219
]
224220

225221
if None not in box_models:

0 commit comments

Comments
 (0)