Variable handleConst

    handle: (target: Writable<Vec>, opts?: HandleOpts) => Handle & {
        anchor: (
            shape: AnyShape & Has<"translate">,
            u: number,
            v: number,
            opts?: HandleOpts,
        ) => Handle;
        centroid: (...shapes: (AnyShape & Has<"translate">)[]) => Handle;
        midpoint: (a: Writable<Vec>, b: Writable<Vec>, opts?: HandleOpts) => Handle;
        move: (shape: AnyShape & Has<"translate">, opts?: HandleOpts) => Handle;
        rotate: (
            shape: AnyShape & Has<"rotate">,
            radius?: number,
            opts?: HandleOpts,
        ) => Handle;
        scale: (
            shape: AnyShape & Has<"scale">,
            radius?: number,
            opts?: HandleOpts,
        ) => Handle;
        tOnPath: (
            p: Path,
            t: Cell<number>,
            opts?: HandleOpts & { samples?: number },
        ) => Handle;
    } = ...

    handle(point) is the atom; .move, .centroid, etc. are sugar.

    Type Declaration

    • anchor: (
          shape: AnyShape & Has<"translate">,
          u: number,
          v: number,
          opts?: HandleOpts,
      ) => Handle

      Drag handle at a specific anchor (u, v) of the shape — drag translates the shape so that anchor lands at the pointer.

    • centroid: (...shapes: (AnyShape & Has<"translate">)[]) => Handle
    • midpoint: (a: Writable<Vec>, b: Writable<Vec>, opts?: HandleOpts) => Handle

      Drag handle at the midpoint of two writable Points — drags both along with it.

    • move: (shape: AnyShape & Has<"translate">, opts?: HandleOpts) => Handle

      Drag handle at the shape's center — drags translate the shape.

    • rotate: (shape: AnyShape & Has<"rotate">, radius?: number, opts?: HandleOpts) => Handle

      Rotation knob orbiting the shape's center at radius; drag to write shape.rotate.

    • scale: (shape: AnyShape & Has<"scale">, radius?: number, opts?: HandleOpts) => Handle
    • tOnPath: (p: Path, t: Cell<number>, opts?: HandleOpts & { samples?: number }) => Handle

      Handle constrained to a Path: each drag projects the pointer onto the path and sets t to the nearest parameter (re-projects, so animated paths work).