Feat(Canvas): Add canvas zoom on Ctrl/Cmd+MMB drag.#8965
Feat(Canvas): Add canvas zoom on Ctrl/Cmd+MMB drag.#8965DustyShoe wants to merge 3 commits intoinvoke-ai:mainfrom
Conversation
|
Main concern: The removal of the ctrlKey inversion in onStageMouseWheel likely breaks trackpad pinch-to-zoom. Browsers dispatch wheel events with ctrlKey: true for pinch gestures — that was the explicit reason for the old inversion. Now those events are ignored by the stage handler and consumed by the tool module as brush/eraser resize instead. This should be clarified with the author before merge; it's not mentioned in the PR description and looks unintentional. Everything else (zoom math, cursor SVG, fallback behavior, snap-state interaction) checks out. |
|
Thanks for calling this out. I checked the existing wheel handling more closely: the stage handler was already returning early on ctrl/meta-modified wheel events before this PR, so the old ctrlKey inversion path was dead code. The line I removed was just a small cleanup while I was already touching nearby canvas zoom code, not an intentional behavior change. So this PR does not newly break trackpad pinch-to-zoom. That said, your broader observation is valid: ctrl/meta-modified wheel events are currently routed to brush/eraser size adjustment in the tool module, which means trackpad pinch-to-zoom does not appear to be supported today. That seems to be pre-existing behavior and is out of scope for this change. I can revert that cleanup from this PR if we want to keep the change set strictly focused on Ctrl/Cmd+MMB zoom. |
Summary
This PR improves canvas UX for graphics tablet users by adding support for the widely used Ctrl/Cmd+MMB zoom gesture.
Ctrl/Cmd+MMB.QA Instructions
Ctrl/Cmd+MMBdrag; verify vertical drag zooms in and out.MMBand verify zoom mode exits cleanly.Ctrl/Cmd+MMBdrag.Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)