wijjit.layout.bounds.parse_margin
- wijjit.layout.bounds.parse_margin(value)[source]
Parse a margin value into a normalized 4-tuple.
- Parameters:
value (
intortupleofint) – Margin specification. If int, applies uniformly to all sides. If tuple, specifies (top, right, bottom, left) margins.- Returns:
Normalized 4-tuple (top, right, bottom, left)
- Return type:
Examples
>>> parse_margin(2) (2, 2, 2, 2) >>> parse_margin((1, 2, 3, 4)) (1, 2, 3, 4)