From 0a188aaf72ddc594038c71c4296aa2ab66ddaf52 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Fri, 13 Sep 2024 11:42:24 +0900 Subject: [PATCH] Disable zoom when editing titles (#813) --- src/components/graph/TitleEditor.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/graph/TitleEditor.vue b/src/components/graph/TitleEditor.vue index 4b38be7ac1..5fb4aa3ad2 100644 --- a/src/components/graph/TitleEditor.vue +++ b/src/components/graph/TitleEditor.vue @@ -20,7 +20,7 @@ import EditableText from '@/components/common/EditableText.vue' import { ComfyExtension } from '@/types/comfy' import { useSettingStore } from '@/stores/settingStore' import type { LiteGraphCanvasEvent } from '@comfyorg/litegraph' -import { useTitleEditorStore } from '@/stores/graphStore' +import { useCanvasStore, useTitleEditorStore } from '@/stores/graphStore' const settingStore = useSettingStore() @@ -36,6 +36,8 @@ const inputStyle = ref({ }) const titleEditorStore = useTitleEditorStore() +const canvasStore = useCanvasStore() +const previousCanvasDraggable = ref(true) const onEdit = (newValue: string) => { if (titleEditorStore.titleEditorTarget && newValue.trim() !== '') { @@ -44,6 +46,7 @@ const onEdit = (newValue: string) => { } showInput.value = false titleEditorStore.titleEditorTarget = null + canvasStore.canvas!.allow_dragcanvas = previousCanvasDraggable.value } watch( @@ -54,6 +57,8 @@ watch( } editedTitle.value = target.title showInput.value = true + previousCanvasDraggable.value = canvasStore.canvas!.allow_dragcanvas + canvasStore.canvas!.allow_dragcanvas = false if (target instanceof LGraphGroup) { const group = target