Internal
Divides positioned rect
by width/height. Useful for normalising a value.
x & y value of second parameter are ignored
// Normalise based on window size
const r = { x: 10, y: 200, width: 100, height: 30 };
const rr = Rects.divide(r, window.innerWidth, window.innerHeight);
Division applies to the first parameter's x/y fields. X is affected by width
, Y is affected by height
.
Optional
height: numberDivides positioned rect a
by width and height of rect b
.
// Returns { ...a, width: a.width / b.width, height: a.height/b.height, x: a.x / b.width, y: a.y / b.height }
Rects.divide(a, b);
Param: a
Param: b
Param: c
Returns