Give canvas pans momentum #15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "momentum-pan"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Releasing a pan now lets the view keep gliding in the drag's direction and slow to a stop, like a phone's scroll momentum. Only the position moves; the zoom never changes.
Behaviour
GLIDE_TAU= 325 ms: the view coasts about 325 px per 1 px/ms of release speed. Speed is capped at 6 px/ms so a wild flick can't throw the view far.Ctrl+0/Ctrl+9) and page jumps stop it.Changes
src/lib/ink/fling.ts:releaseVelocity()(now also used byflingDir),glideStep()and the tuning constants.src/lib/state/viewport.svelte.ts:glide()/stopGlide(); other view changes cancel a glide.src/lib/components/CanvasView.svelte: starts the glide on pan release and stops it on pointer down.Testing
npm test: 55/55 passing;npm run check: 0 errors, 0 warnings (run in anode:24-alpinePodman container).🤖 Generated with Claude Code
https://claude.ai/code/session_015cuSqnxerdvXU934U9DddL