@witchcraft/spellcraft
    Preparing search index...
    • Returns a set of coordinates that includes an initial offset.

      For use with drag or similar events.

      setInitialOffset should be called at drag start.

      setPointerCoords can then be called on drag move.

      And coords will reflect the coordinates of the event + the initial offset.

      This can then be used to position an element and it won't jump, it will stay grabbed from where the user initially grabbed it.

      Returns {
          coords: ComputedRef<{ x: number; y: number }>;
          pointerCoords: { x: number; y: number };
          setInitialPointerOffset: (
              e: { clientX: number; clientY: number },
              el: HTMLElement,
          ) => void;
          setPointerCoords: (e: { clientX: number; clientY: number }) => void;
      }