File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/renderer/core/canvas/links Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type { LinkConnector } from '@/lib/litegraph/src/canvas/LinkConnector'
55import type { RenderLink } from '@/lib/litegraph/src/canvas/RenderLink'
66import type { CanvasPointerEvent } from '@/lib/litegraph/src/types/events'
77import { app } from '@/scripts/app'
8+ import { isSubgraph } from '@/utils/typeGuardUtil'
89
910// Keep one adapter per graph so rendering and interaction share state.
1011const adapterByGraph = new WeakMap < LGraph , LinkConnectorAdapter > ( )
@@ -130,6 +131,15 @@ export class LinkConnectorAdapter {
130131
131132 /** Drops moving links onto the canvas (no target). */
132133 dropOnCanvas ( event : CanvasPointerEvent ) : void {
134+ //Add extra check for connection to subgraphInput/subgraphOutput
135+ if ( isSubgraph ( this . network ) ) {
136+ const { canvasX, canvasY } = event
137+ const ioNode = this . network . getIoNodeOnPos ?.( canvasX , canvasY )
138+ if ( ioNode ) {
139+ this . linkConnector . dropOnIoNode ( ioNode , event )
140+ return
141+ }
142+ }
133143 this . linkConnector . dropOnNothing ( event )
134144 }
135145
You can’t perform that action at this time.
0 commit comments