Interface: Rect
Lightweight 2D geometry primitives + intersection helpers. Plain object shapes (not classes) so they're cheap to JSON-roundtrip and play nicely with renderer payloads that already use { x, y, width, height } (hit areas, rendering rects).
Conventions:
- Rect uses top-left origin with positive Y down (canvas / DOM convention).
- Circle is centered at (x, y) with radius r.
- "Intersects" tests are inclusive — touching at an edge counts as intersecting.
Properties
| Property | Type |
|---|---|
height | number |
width | number |
x | number |
y | number |