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

    Function guideSnapStrategy

    • Snap-strategy that snaps the pose's origin to the nearest guide line on each axis when within tolerance. Each axis is considered independently: a vertical guide (axis: 'x') constrains X, a horizontal guide (axis: 'y') constrains Y. When multiple guides are within range on the same axis, the closest wins.

      Pair with useGuides for storage and createGuidesLayer for rendering.

      Composition: combining with gridSnapStrategy is left to the consumer in v1 — typically by picking one based on a modifier key, or by stacking two move/resize/insert behaviors in priority order.

      Type Parameters

      • TPose extends { x: number; y: number }

      Parameters

      Returns SnapStrategy<TPose>

    • Snap-strategy that snaps the pose's origin to the nearest guide line on each axis when within tolerance. Each axis is considered independently: a vertical guide (axis: 'x') constrains X, a horizontal guide (axis: 'y') constrains Y. When multiple guides are within range on the same axis, the closest wins.

      Pair with useGuides for storage and createGuidesLayer for rendering.

      Composition: combining with gridSnapStrategy is left to the consumer in v1 — typically by picking one based on a modifier key, or by stacking two move/resize/insert behaviors in priority order.

      Type Parameters

      • TPose

      Parameters

      Returns SnapStrategy<TPose>