feat(stammbaum): animate fit-to-screen, snap under reduced motion (#692)
Fit-to-screen tweens to the default view over 300ms via animateView (eased, lerpView-driven) and snaps instantly when prefers-reduced-motion is set (US-PAN-004 AC2, NFR-A11Y-003). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -113,6 +113,15 @@ export function zoomAtPoint(
|
||||
};
|
||||
}
|
||||
|
||||
/** Linearly interpolate between two view states (drives fit/recentre tweening). */
|
||||
export function lerpView(from: PanZoomState, to: PanZoomState, t: number): PanZoomState {
|
||||
return {
|
||||
x: from.x + (to.x - from.x) * t,
|
||||
y: from.y + (to.y - from.y) * t,
|
||||
z: from.z + (to.z - from.z) * t
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamp the pan offset so the canvas cannot be dragged off the edge (US-PAN-001
|
||||
* AC4 — no infinite scroll). The pannable range on each axis is half the
|
||||
|
||||
Reference in New Issue
Block a user