Skip to content

[1/2] feat: add canvas zoom buttons for touch screens - #328

Merged
dazzatronus merged 1 commit into
mainfrom
feat/canvas-zoom-buttons
Dec 2, 2026
Merged

dazzatronus merged 1 commit into
mainfrom
feat/canvas-zoom-buttons

Conversation

@dazzatronus

@dazzatronus dazzatronus commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The canvas could only be zoomed with Ctrl+wheel, which touch screens don't have. Zoom out, Fit and Zoom in buttons now sit at the canvas's bottom-right under (pointer: coarse), and mouse-first machines render pixel-identical. They zoom about the viewport centre through a new internal zoomBy, because setZoom scales about the content's corner and would walk the edit off-screen. Ctrl+wheel now goes through zoomBy too, and a test pins it to the old formula across 40 cases, including both clamps.

This PR is 461 delta lines; 241 of them are tests (the wheel parity oracle and the buttons).

Verify: on both devices the three buttons are 44×44 px:

  • Zoom in multiplies the zoom by 1.2, and Zoom out divides it by 1.2.
  • Fit goes back to the fitted zoom.
  • visualViewport.scale stays 1.

In desktop Chromium at 1280 and 500 px wide, the buttons take up no space (0×0). npx jest: 2749 pass.

# PR Adds Why it is separate
1/2 #328 (this PR) Canvas zoom buttons on touch screens Tap alternative ships before the gesture
2/2 #330 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 4869fab into main Dec 2, 2026
1 check passed
@dazzatronus
dazzatronus deleted the feat/canvas-zoom-buttons 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