spacing diagram

This commit is contained in:
Will McGugan
2023-05-10 22:40:15 +02:00
parent a065ff572e
commit 4434b59982
2 changed files with 14 additions and 2 deletions

BIN
reference/spacing.monopic Normal file

Binary file not shown.

View File

@@ -853,7 +853,7 @@ class Region(NamedTuple):
Args:
cut: An offset from self.y where the cut should be made. May be negative,
for the offset to start from the bottom edge.
for the offset to start from the lower edge.
Returns:
Two regions, which add up to the original (self).
@@ -909,7 +909,19 @@ class Region(NamedTuple):
class Spacing(NamedTuple):
"""The spacing around a renderable, such as padding and border
Spacing is defined by four integers for the space at the top, right, bottom, and left of a region,
Spacing is defined by four integers for the space at the top, right, bottom, and left of a region.
```
┌ ─ ─ ─ ─ ─ ─ ─▲─ ─ ─ ─ ─ ─ ─ ─ ┐
│ top
│ ┏━━━━━▼━━━━━━┓ │
◀──────▶┃ ┃◀───────▶
│ left ┃ ┃ right │
┃ ┃
│ ┗━━━━━▲━━━━━━┛ │
│ bottom
└ ─ ─ ─ ─ ─ ─ ─▼─ ─ ─ ─ ─ ─ ─ ─ ┘
```
Example:
```python