From b922aa5c7cc43ff8d16a461b19fa7274f0e99ef0 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Sat, 16 Nov 2024 01:10:09 +1100 Subject: [PATCH] Add option to disable ctrl + shift + zoom (#1545) * Add option to disable ctrl + shift + zoom Minor change to default behaviour: zoom no longer triggers if alt key is also down. * Update coreSettings.ts Next release will be 1.4.0 to leave room for patches in 1.3 stable after today's main repo sync. --------- Co-authored-by: Chenlei Hu --- src/scripts/app.ts | 3 ++- src/stores/coreSettings.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/scripts/app.ts b/src/scripts/app.ts index c4a431926..b2711430e 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -1227,7 +1227,8 @@ export class ComfyApp { const origProcessMouseDown = LGraphCanvas.prototype.processMouseDown LGraphCanvas.prototype.processMouseDown = function (e) { // prepare for ctrl+shift drag: zoom start - if (e.ctrlKey && e.shiftKey && e.buttons) { + const useFastZoom = useSettingStore().get('Comfy.Graph.CtrlShiftZoom') + if (useFastZoom && e.ctrlKey && e.shiftKey && !e.altKey && e.buttons) { self.zoom_drag_start = [e.x, e.y, this.ds.scale] return } diff --git a/src/stores/coreSettings.ts b/src/stores/coreSettings.ts index d1c90fb28..c88ac00d6 100644 --- a/src/stores/coreSettings.ts +++ b/src/stores/coreSettings.ts @@ -521,5 +521,12 @@ export const CORE_SETTINGS: SettingParams[] = [ name: 'Enable DOM element clipping (enabling may reduce performance)', type: 'boolean', defaultValue: true + }, + { + id: 'Comfy.Graph.CtrlShiftZoom', + name: 'Enable fast-zoom shortcut (Ctrl + Shift + Drag)', + type: 'boolean', + defaultValue: true, + versionAdded: '1.4.0' } ]