mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-11 16:10:05 +00:00
Update litegraph (Zoom speed adjustment) (#580)
This commit is contained in:
@@ -64,6 +64,15 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const zoomSpeed = computed(() => settingStore.get('Comfy.Graph.ZoomSpeed'))
|
||||
watch(
|
||||
zoomSpeed,
|
||||
(newVal: number) => {
|
||||
if (comfyApp.canvas) comfyApp.canvas['zoom_speed'] = newVal
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watchEffect(() => {
|
||||
nodeDefStore.showDeprecated = settingStore.get('Comfy.Node.ShowDeprecated')
|
||||
})
|
||||
@@ -94,6 +103,7 @@ onMounted(async () => {
|
||||
await comfyApp.setup(canvasRef.value)
|
||||
comfyApp.canvas.allow_searchbox = !nodeSearchEnabled.value
|
||||
comfyApp.canvas.show_info = canvasInfoEnabled.value
|
||||
comfyApp.canvas['zoom_speed'] = zoomSpeed.value
|
||||
workspaceStore.spinner = false
|
||||
|
||||
window['app'] = comfyApp
|
||||
|
||||
@@ -172,6 +172,18 @@ export const useSettingStore = defineStore('setting', {
|
||||
type: 'boolean',
|
||||
defaultValue: true
|
||||
})
|
||||
|
||||
app.ui.settings.addSetting({
|
||||
id: 'Comfy.Graph.ZoomSpeed',
|
||||
name: 'Canvas zoom speed',
|
||||
type: 'slider',
|
||||
defaultValue: 1.1,
|
||||
attrs: {
|
||||
min: 1.01,
|
||||
max: 2.5,
|
||||
step: 0.01
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
set<K extends keyof Settings>(key: K, value: Settings[K]) {
|
||||
|
||||
@@ -410,6 +410,7 @@ const zSettings = z.record(z.any()).and(
|
||||
'Comfy.EnableTooltips': z.boolean(),
|
||||
'Comfy.EnableWorkflowViewRestore': z.boolean(),
|
||||
'Comfy.FloatRoundingPrecision': z.number(),
|
||||
'Comfy.Graph.ZoomSpeed': z.number(),
|
||||
'Comfy.InvertMenuScrolling': z.boolean(),
|
||||
'Comfy.Logging.Enabled': z.boolean(),
|
||||
'Comfy.NodeInputConversionSubmenus': z.boolean(),
|
||||
|
||||
Reference in New Issue
Block a user