Skip to content

feat(preview): add pinch-to-zoom and keyboard zoom shortcuts  #453

Open
Isioma20 wants to merge 2 commits into
shellscape:mainfrom
Isioma20:feat/preview-zoom-controls 

Hidden character warning

The head ref may contain hidden characters: "feat/preview-zoom-controls\u00a0"
Open

feat(preview): add pinch-to-zoom and keyboard zoom shortcuts  #453
Isioma20 wants to merge 2 commits into
shellscape:mainfrom
Isioma20:feat/preview-zoom-controls 

Conversation

@Isioma20
Copy link
Copy Markdown

Component / Package Name:

Preview

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

  • Adds pinch-to-zoom (trackpad) and Ctrl+scroll support for continuous canvas zoom
  • Adds Cmd+scroll for step-based zoom
  • Adds Cmd+/Cmd- keyboard shortcuts for zoom in/out and Cmd+0 to reset to 100%
  • All interactions anchor zoom to cursor position for natural feel
  • Prevents browser native zoom from interfering

Video Demo:
https://github.com/user-attachments/assets/7a943e43-e447-4ff4-bdd1-b4377dfbe0bb

Test plan

  • Pinch to zoom on trackpad zooms canvas smoothly
  • Ctrl + mouse scroll zooms continuously
  • Cmd + mouse scroll zooms in steps
  • Cmd+= zooms in, Cmd+- zooms out, Cmd+0 resets to 100%
  • Zoom anchors to cursor position (content stays focused where you're looking)
  • Header zoom buttons still work as before
  • Z+click / Z+Alt+click zoom still works
  • Templates panel and tool panel are excluded from zoom gestures
  • Zoom stays clamped within bounds

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant