rect shrunk by amount on every side.
- rect: the rectangle to shrink.
- amount: how far to move each edge in. The size stops at zero instead of going negative.
r := inset(.{ 0, 0, 100, 40 }, 10);
assert(r.x == 10 && r.w == 80 && r.h == 20);inset :: (rect: Rect, amount: float) -> Rect
rect shrunk by amount on every side.
Parameters
- rect: Rect
- the rectangle to shrink.
- amount: float
- how far to move each edge in. The size stops at zero instead of going negative.
Returns
r := inset(.{ 0, 0, 100, 40 }, 10);
assert(r.x == 10 && r.w == 80 && r.h == 20);