mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-04 05:02:17 +00:00
refactor: use read_only as signal, let events bubble to litegraph
- Set canvas.read_only directly when spacebar pressed - Skip stopPropagation when read_only is true in slot link handler - Remove manual dragging_canvas and processMouseMove management - Litegraph handles panning through its normal event handlers
This commit is contained in:
@@ -32,17 +32,8 @@ watch(space, (isPressed) => {
|
||||
if (activeElement.value === canvas.canvas) return
|
||||
if (isEditableElement(activeElement.value || null)) return
|
||||
|
||||
// Mirror litegraph's processKey behavior for spacebar
|
||||
if (isPressed) {
|
||||
canvas.read_only = true
|
||||
// Set dragging_canvas based on current pointer state
|
||||
if (canvas.pointer?.isDown) {
|
||||
canvas.dragging_canvas = true
|
||||
}
|
||||
} else {
|
||||
canvas.read_only = false
|
||||
canvas.dragging_canvas = false
|
||||
}
|
||||
// pointer events will bubble to litegraph
|
||||
canvas.read_only = isPressed
|
||||
})
|
||||
|
||||
export function useNodePointerInteractions(
|
||||
|
||||
Reference in New Issue
Block a user