Curve that exactly tracks a Simulation's position over its duration.
Maps normalized animation time t ∈ [0, 1] to normalized position
progress ∈ [0, 1].
Discrete direction state for a per-axis drag/release. Four-value
taxonomy that mirrors FrictionConfig's slots: combines
extending-vs-retracting (motion sign relative to base) with
in-display-vs-past-display (rect's actual edge vs display edge).
Picks the matching Friction ramp from a FrictionConfig for the
given direction state. One-line mapping that mirrors the enum's
shape to the config's four slots.
Pure rect-construction helper. Takes the final per-axis newCenter
(already decided by the caller's routing — scaleResponse center,
anchor center, or friction-translated current center) and the final
scaleFactor (multiplier on baseRect's width). Builds the new
rect centered at newCenter with newWidth = baseRect.width * scaleFactor, newHeight = newWidth / aspectRatio.
New rect for a DragGesture update. Free pan (no scaleResponse) is
pure friction-damped translation; scaleResponse routes through the
anchor pipeline (focal-preserving size + position).
Default focal-point-preserving anchor: the rect.center is positioned so
the user's finger stays at the same relative point of the rect as it
scales. Used when no Overrides.anchor is configured.
Four-value X-axis direction state: combines the motion direction
(extending vs retracting, decided by delta's sign relative to
boundForX) with whether the rect's relevant edge is past the
display edge.
Resolves a drag gesture from the registered map for the accumulated
motion vector. Returns the matching ActiveGesture, or null if no axis
has crossed minDistance yet, or no registered key matches.
Resolves a scale gesture from the registered map for the current scale
magnitude. Returns the first eligible entry, or null if scale is below
the commit threshold or no gesture qualifies.
Per-axis scaleResponse: given the rect's center on the axis, returns
the corresponding scale factor by reading the lerp between geometric
endpoints. In-display zone end = "rect's near edge touches display
edge, size = base * inDisplay.end"; past-display zone end =
"rect's far edge touches display edge, size = base * pastDisplay.end".