ixfx
    Preparing search index...
    • Constrains the 'position' property of a ForceAffected thing to be within bounds. If position is undefined, the thing is returned unaltered.

      const f = contrainWrap({ width: window.innerWidth, height: window.innerHeight });
      f(thing);

      Type Parameters

      Parameters

      • Optionalbounds: Rect

        Bounds to contrain to. Defaults to {width:1, height:1}

      Returns ForceFn<T>

      Function that can be applied to a ForceAffected thing to constrain its position within bounds