Constrains the 'position' property of a ForceAffected thing to be within bounds. If position is undefined, the thing is returned unaltered.
position
const f = contrainWrap({ width: window.innerWidth, height: window.innerHeight });f(thing); Copy
const f = contrainWrap({ width: window.innerWidth, height: window.innerHeight });f(thing);
Optional
Bounds to contrain to. Defaults to {width:1, height:1}
{width:1, height:1}
Function that can be applied to a ForceAffected thing to constrain its position within bounds
Constrains the 'position' property of a ForceAffected thing to be within bounds. If
positionis undefined, the thing is returned unaltered.