Generic snap behavior factory: wraps a SnapStrategy and returns a
MoveBehavior whose onMove returns a uniform GroupTransform.
Implementation:
Compute the primary's proposed pose by applying the gesture's
transform (translate) to origin.get(primaryId).
Call strategy.snap(proposed). If null, no-op.
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.
Generic snap behavior factory: wraps a
SnapStrategyand returns aMoveBehaviorwhoseonMovereturns a uniformGroupTransform.Implementation:
transform(translate) toorigin.get(primaryId).strategy.snap(proposed). If null, no-op.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). Passoriginfor exotic poses.