Skip to content

Commit ea9cb3c

Browse files
authored
Allow Macs to zoom with Cmd + wheel (#5143)
* Allow Mac to zoom with cmd+wheel * Only zoom when exact modifier pressed
1 parent 11f5439 commit ea9cb3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/litegraph/src/LGraphCanvas.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3498,8 +3498,11 @@ export class LGraphCanvas
34983498

34993499
// Detect if this is a trackpad gesture or mouse wheel
35003500
const isTrackpad = this.pointer.isTrackpadGesture(e)
3501+
const isCtrlOrMacMeta =
3502+
e.ctrlKey || (e.metaKey && navigator.platform.includes('Mac'))
3503+
const isZoomModifier = isCtrlOrMacMeta && !e.altKey && !e.shiftKey
35013504

3502-
if (e.ctrlKey || LiteGraph.canvasNavigationMode === 'legacy') {
3505+
if (isZoomModifier || LiteGraph.canvasNavigationMode === 'legacy') {
35033506
// Legacy mode or standard mode with ctrl - use wheel for zoom
35043507
if (isTrackpad) {
35053508
// Trackpad gesture - use smooth scaling

0 commit comments

Comments
 (0)