weasel API - v0.8.0
    Preparing search index...

    Interface UseDragRectOptions<TScratch>

    interface UseDragRectOptions<TScratch = unknown> {
        initScratch?: () => TScratch;
        minBounds?: { height: number; width: number };
        onCancel?: (ctx: DragRectCtx<TScratch>) => void;
        onEnd?: (ctx: DragRectEndCtx<TScratch>) => boolean | void;
        onGestureEnd?: (committed: boolean) => void;
        onGestureStart?: () => void;
        onMove?: (ctx: DragRectCtx<TScratch>) => void;
        onStart?: (ctx: DragRectCtx<TScratch>) => void;
        snapPoint?: (p: DragRectPoint) => DragRectPoint;
    }

    Type Parameters

    • TScratch = unknown
    Index

    Properties

    initScratch?: () => TScratch
    minBounds?: { height: number; width: number }
    onCancel?: (ctx: DragRectCtx<TScratch>) => void
    onEnd?: (ctx: DragRectEndCtx<TScratch>) => boolean | void
    onGestureEnd?: (committed: boolean) => void
    onGestureStart?: () => void
    onMove?: (ctx: DragRectCtx<TScratch>) => void
    onStart?: (ctx: DragRectCtx<TScratch>) => void
    snapPoint?: (p: DragRectPoint) => DragRectPoint

    Optional: snap world-space points to the active grid (or any other snap target). Applied to every coord the gesture ingests (start point on onStart, current point on onMove), so both the live overlay and the committed bounds track the snapped values. When omitted, behavior is identical to today (identity passthrough).