9-Slice scaling math.
left right ┌──→ +x
┊←──── outer ────→┊ │
┊ ┊ ↓
┊ ┊←─ inner ─→┊ ┊ + y
┊ ┊ ┊ ┊
┌──┬───────────┬──┐┈┈┈┈┈┈┈┈ top
│ │ │ │ ↑
├──┼───────────┼──┤┈┈┈┈ │
│ │ │ │ ↑ │
│ │ │ │ inner outer
│ │ │ │ ↓ │
├──┼───────────┼──┤┈┈┈┈ │
│ │ │ │ ↓
└──┴───────────┴──┘┈┈┈┈┈┈ bottom
References
- Wikipedia: 9-slice scaling
- Unity: 9-slicing Sprites
- CSS Backgrounds and Borders ML3: ¶6 Border Images
Crate Features
feature | Overview |
---|---|
debug | Enable extra asserts for debugging nines itself. |
unsigned-scalar | Allow Scalar to use underflow-prone uNN types. |