Allow Macs to zoom with Cmd + wheel (#5143)

* Allow Mac to zoom with cmd+wheel

* Only zoom when exact modifier pressed
This commit is contained in:
filtered
2025-08-21 15:18:04 +10:00
committed by GitHub
parent 11f5439d29
commit ea9cb3cb45

View File

@@ -3498,8 +3498,11 @@ export class LGraphCanvas
// Detect if this is a trackpad gesture or mouse wheel
const isTrackpad = this.pointer.isTrackpadGesture(e)
const isCtrlOrMacMeta =
e.ctrlKey || (e.metaKey && navigator.platform.includes('Mac'))
const isZoomModifier = isCtrlOrMacMeta && !e.altKey && !e.shiftKey
if (e.ctrlKey || LiteGraph.canvasNavigationMode === 'legacy') {
if (isZoomModifier || LiteGraph.canvasNavigationMode === 'legacy') {
// Legacy mode or standard mode with ctrl - use wheel for zoom
if (isTrackpad) {
// Trackpad gesture - use smooth scaling