Skip to content

[2/2] feat: pinch and pan the canvas on touch - #330

Merged
dazzatronus merged 1 commit into
feat/canvas-zoom-buttonsfrom
feat/touch-canvas-zoom
Dec 2, 2026
Merged

dazzatronus merged 1 commit into
feat/canvas-zoom-buttonsfrom
feat/touch-canvas-zoom

Conversation

@dazzatronus

@dazzatronus dazzatronus commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Two fingers on the canvas now zoom about their midpoint and pan, through the same zoomBy maths as the buttons. One finger behaves as before. A second finger landing mid-drag puts the clip back where it started and records nothing: no history entry, and the document only gets back the keys the drag changed. A key the drag created is restored as an undefined value, which JSON and the render payload read as absent.

Safari's gesturestart and gesturechange are prevented only while a touch pinch is on the canvas, so trackpad zoom on macOS is unchanged. Ctrl+wheel and middle-button pan are unchanged.

This PR is 537 delta lines, mostly tests for the gesture tracker, the cancel paths and the Canvas wiring.

Verify: on both devices:

  • A two-finger spread from 60 to 200 px zooms the canvas ×3.33, and pinching in zooms it ×0.30.
  • A two-finger move of (80, 50) px pans the canvas by the same amount.
  • visualViewport.scale stays 1.

On the iPhone, a one-finger drag edits exactly as on 2.34.0. A second finger landing mid-drag leaves the edit byte-identical, with no history entry.

npx jest: 2779 pass.

# PR Adds Why it is separate
1/2 #328 Canvas zoom buttons on touch screens Tap alternative ships before the gesture
2/2 #330 (this PR) Pinch and pan the canvas Multi-finger gesture on top

Merge bottom-up. Retarget the 2/2 PR to main after the 1/2 lands.

@dazzatronus
dazzatronus added this pull request to stack #332 December 2, 2026 06:31
@dazzatronus
dazzatronus merged commit 7ac2c33 into main Dec 2, 2026
1 check passed
@dazzatronus
dazzatronus deleted the feat/touch-canvas-zoom branch December 2, 2026 06:34
github-actions Bot pushed a commit that referenced this pull request Dec 2, 2026
# [2.35.0](v2.34.0...v2.35.0) (2026-12-02)

### Features

* add canvas zoom buttons for touch screens ([#328](#328)) ([4869fab](4869fab))
* lift a clip with a long press on touch ([#327](#327)) ([70a1690](70a1690))
* pinch and pan the canvas on touch ([#330](#330)) ([7ac2c33](7ac2c33))
* zoom the timeline with a pinch ([#329](#329)) ([97ed07c](97ed07c))
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant