Give canvas pans momentum

Releasing a pan now lets the view glide on in the drag's direction,
slowing under exponential drag (time constant GLIDE_TAU = 325 ms, so it
coasts about 325 px per 1 px/ms of release speed). Only the position
moves; the zoom is untouched. A drag that stops before lifting doesn't
glide. Touching the canvas, wheel, zoom or fit stops a glide.

Applies to finger, mouse (middle/space/background drag) and pen pans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015cuSqnxerdvXU934U9DddL
This commit is contained in:
agent 2026-09-30 19:38:57 +00:00
parent 8a3d2224a7
commit 9b13dee725
5 changed files with 129 additions and 14 deletions

View file

@ -28,7 +28,7 @@ The image builds the PWA and serves it with nginx. Put an HTTPS reverse proxy in
- **Pages**: the "+" circles beside the active page add a page there (a quick finger flick toward a free side offers one there; turn it off under Settings → Pen & touch); `Alt+Arrow` moves to (or creates) the neighbour. Right-click a page or use its `⋯` button to insert, resize or delete it.
- **Grid**: the faint background grid has one cell per active page; Settings → Appearance can hide it or subdivide it.
- **Importing a PDF** into a non-empty canvas shows every free spot; click one to place the chain. Into a blank canvas it simply replaces the empty page. The Files panel can also import a PDF as a new canvas.
- **View**: wheel/trackpad pans, `Ctrl`+wheel or pinch zooms, `Ctrl+0` fits the page, `Ctrl+9` shows the whole tree, space-drag or middle-drag pans.
- **View**: wheel/trackpad pans, `Ctrl`+wheel or pinch zooms, `Ctrl+0` fits the page, `Ctrl+9` shows the whole tree, space-drag or middle-drag pans. A drag keeps gliding for a moment after you let go and slows to a stop (the zoom never changes); touching the canvas catches it. The drag strength is `GLIDE_TAU` in `src/lib/ink/fling.ts`.
- **Sync**: Settings → Sync. Use a fine-grained token with *Contents: read & write* on the repo. Edits autosave locally; pushes happen every N minutes and on `Ctrl+S` / the sync button. Conflicts: newer wins.
## Layout