mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Dont use Spacing.all in geometry
This commit is contained in:
@@ -628,11 +628,11 @@ class Spacing(NamedTuple):
|
||||
def unpack(cls, pad: SpacingDimensions) -> Spacing:
|
||||
"""Unpack padding specified in CSS style."""
|
||||
if isinstance(pad, int):
|
||||
return Spacing.all(pad)
|
||||
return cls(pad, pad, pad, pad)
|
||||
pad_len = len(pad)
|
||||
if pad_len == 1:
|
||||
_pad = pad[0]
|
||||
return Spacing.all(_pad)
|
||||
return cls(_pad, _pad, _pad, _pad)
|
||||
if pad_len == 2:
|
||||
pad_top, pad_right = cast(Tuple[int, int], pad)
|
||||
return cls(pad_top, pad_right, pad_top, pad_right)
|
||||
|
||||
Reference in New Issue
Block a user