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:
Johnpaul
2025-12-31 06:58:50 +01:00
parent 3cf19af173
commit fc082d84b9
2 changed files with 4 additions and 18 deletions

View File

@@ -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(