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

    Function useRectTool

    • Drag-to-draw rectangle tool.

      The gesture is owned end-to-end by the dispatcher: the drag binding routes to insertAction, which tracks the live bounds, paints the preview through its overlay() surface, and commits via the insert dep on release. <SceneCanvas> sources that dep from useInsertDepSource; consumers wanting a custom node factory override the dep (useDepSource('insert', …)) rather than the tool.

      Grid snapping comes from the snap dep, also read by insertAction — see SnapDep in interactions/actions/depSchema.ts.

      Returns Tool<null>