mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
Replace locking/unlocking of canvas with select/pan mode (#1050)
* Add dragging canvas state * Change icon * Add playwright test * tooltip change * Enable for legacy menu * Update litegraph * Hide canvas menu for test
This commit is contained in:
@@ -13,6 +13,7 @@ export const useTitleEditorStore = defineStore('titleEditor', () => {
|
||||
export const useCanvasStore = defineStore('canvas', () => {
|
||||
const canvas = shallowRef<LGraphCanvas | null>(null)
|
||||
const readOnly = ref(false)
|
||||
const draggingCanvas = ref(false)
|
||||
|
||||
document.addEventListener(
|
||||
'litegraph:canvas',
|
||||
@@ -23,8 +24,18 @@ export const useCanvasStore = defineStore('canvas', () => {
|
||||
}
|
||||
)
|
||||
|
||||
document.addEventListener(
|
||||
'litegraph:canvas',
|
||||
(e: CustomEvent<{ subType: string; draggingCanvas: boolean }>) => {
|
||||
if (e.detail?.subType === 'dragging-canvas') {
|
||||
draggingCanvas.value = e.detail.draggingCanvas
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
canvas,
|
||||
readOnly
|
||||
readOnly,
|
||||
draggingCanvas
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user