mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 18:22:40 +00:00
Add macOS trackpad gesture support (#1007)
Adds trackpad gesture support to canvas interaction. Supports: - Pinch to zoom - Two-finger panning Feature is off by default. Also by default, the browser user-agent must include "Mac" (even if the feature has been enabled). ```ts // Enable mac trackpad gestures LiteGraph.macTrackpadGestures = true // Disable the default Mac user-agent check LiteGraph.macGesturesRequireMac = false ```
This commit is contained in:
@@ -276,6 +276,22 @@ export class LiteGraphGlobal {
|
||||
*/
|
||||
onDeprecationWarning: ((message: string, source?: object) => void)[] = [console.warn]
|
||||
|
||||
/**
|
||||
* If `true`, mouse wheel events will be interpreted as trackpad gestures.
|
||||
* Tested on MacBook M4 Pro.
|
||||
* @default false
|
||||
* @see macGesturesRequireMac
|
||||
*/
|
||||
macTrackpadGestures: boolean = false
|
||||
|
||||
/**
|
||||
* If both this setting and {@link macTrackpadGestures} are `true`, trackpad gestures will
|
||||
* only be enabled when the browser user agent includes "Mac".
|
||||
* @default true
|
||||
* @see macTrackpadGestures
|
||||
*/
|
||||
macGesturesRequireMac: boolean = true
|
||||
|
||||
// TODO: Remove legacy accessors
|
||||
LGraph = LGraph
|
||||
LLink = LLink
|
||||
|
||||
Reference in New Issue
Block a user