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

    Function snap

    • Generic snap behavior factory: wraps a SnapStrategy and returns a MoveBehavior whose onMove returns a uniform GroupTransform.

      Implementation:

      1. Compute the primary's proposed pose by applying the gesture's transform (translate) to origin.get(primaryId).
      2. Call strategy.snap(proposed). If null, no-op.
      3. Derive the snapped delta via the OriginProjection: dx = origin(snapped).x - origin(originPose).x ...so the gesture applies the same delta to every dragged id.

      The pose-shape-aware delta extraction lives here — gestures stay pose-shape agnostic. Default projection is {x, y}-bearing (rect / path / polygon). Pass origin for exotic poses.

      Type Parameters

      • TPose

      Parameters

      Returns MoveBehavior<TPose>