mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 09:30:06 +00:00
Move Comfy.EnableWorkflowViewRestore to coreSettings (#1767)
This commit is contained in:
@@ -650,5 +650,13 @@ export const CORE_SETTINGS: SettingParams[] = [
|
||||
},
|
||||
defaultValue: 0,
|
||||
versionAdded: '1.5.1'
|
||||
},
|
||||
{
|
||||
id: 'Comfy.EnableWorkflowViewRestore',
|
||||
category: ['Comfy', 'Workflow', 'EnableWorkflowViewRestore'],
|
||||
name: 'Save and restore canvas position and zoom level in workflows',
|
||||
type: 'boolean',
|
||||
defaultValue: true,
|
||||
versionModified: '1.5.4'
|
||||
}
|
||||
]
|
||||
|
||||
@@ -154,6 +154,9 @@
|
||||
"Comfy_EnableTooltips": {
|
||||
"name": "Enable Tooltips"
|
||||
},
|
||||
"Comfy_EnableWorkflowViewRestore": {
|
||||
"name": "Save and restore canvas position and zoom level in workflows"
|
||||
},
|
||||
"Comfy_Extension_Disabled": {
|
||||
"name": "Disabled extension names"
|
||||
},
|
||||
|
||||
@@ -188,6 +188,9 @@
|
||||
"Comfy_EnableTooltips": {
|
||||
"name": "ツールチップを有効にする"
|
||||
},
|
||||
"Comfy_EnableWorkflowViewRestore": {
|
||||
"name": "ワークフロー内のキャンバスの位置とズームレベルを保存および復元する"
|
||||
},
|
||||
"Comfy_Extension_Disabled": {
|
||||
"name": "無効な拡張機能名"
|
||||
},
|
||||
|
||||
@@ -188,6 +188,9 @@
|
||||
"Comfy_EnableTooltips": {
|
||||
"name": "Включить подсказки"
|
||||
},
|
||||
"Comfy_EnableWorkflowViewRestore": {
|
||||
"name": "Сохранять и восстанавливать положение и уровень масштабирования холста в рабочих процессах"
|
||||
},
|
||||
"Comfy_Extension_Disabled": {
|
||||
"name": "Отключенные имена расширений"
|
||||
},
|
||||
|
||||
@@ -188,6 +188,9 @@
|
||||
"Comfy_EnableTooltips": {
|
||||
"name": "启用工具提示"
|
||||
},
|
||||
"Comfy_EnableWorkflowViewRestore": {
|
||||
"name": "在工作流中保存和恢复画布位置及缩放级别"
|
||||
},
|
||||
"Comfy_Extension_Disabled": {
|
||||
"name": "禁用的扩展名称"
|
||||
},
|
||||
|
||||
@@ -131,7 +131,6 @@ export class ComfyApp {
|
||||
_nodeOutputs: Record<string, any>
|
||||
nodePreviewImages: Record<string, typeof Image>
|
||||
graph: LGraph
|
||||
enableWorkflowViewRestore: any
|
||||
canvas: LGraphCanvas
|
||||
dragOverNode: LGraphNode | null
|
||||
canvasEl: HTMLCanvasElement
|
||||
@@ -464,7 +463,7 @@ export class ComfyApp {
|
||||
const workflow = serialize.apply(this, arguments)
|
||||
|
||||
// Store the drag & scale info in the serialized workflow if the setting is enabled
|
||||
if (self.enableWorkflowViewRestore.value) {
|
||||
if (useSettingStore().get('Comfy.EnableWorkflowViewRestore')) {
|
||||
if (!workflow.extra) {
|
||||
workflow.extra = {}
|
||||
}
|
||||
@@ -479,13 +478,6 @@ export class ComfyApp {
|
||||
|
||||
return workflow
|
||||
}
|
||||
this.enableWorkflowViewRestore = this.ui.settings.addSetting({
|
||||
id: 'Comfy.EnableWorkflowViewRestore',
|
||||
category: ['Comfy', 'Workflow', 'EnableWorkflowViewRestore'],
|
||||
name: 'Save and restore canvas position and zoom level in workflows',
|
||||
type: 'boolean',
|
||||
defaultValue: true
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2168,7 +2160,7 @@ export class ComfyApp {
|
||||
this.graph.configure(graphData)
|
||||
if (
|
||||
restore_view &&
|
||||
this.enableWorkflowViewRestore.value &&
|
||||
useSettingStore().get('Comfy.EnableWorkflowViewRestore') &&
|
||||
graphData.extra?.ds
|
||||
) {
|
||||
// @ts-expect-error
|
||||
|
||||
Reference in New Issue
Block a user