File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2851,6 +2851,12 @@ export class LGraphCanvas
2851
2851
2852
2852
this . dirty_canvas = true
2853
2853
}
2854
+ passPointerEvent ( pointer : CanvasPointer , node : LGraphNode ) : boolean {
2855
+ pointer . onDragStart = ( ) => this . #startDraggingItems( node , pointer )
2856
+ pointer . onDragEnd = ( e ) => this . #processDraggedItems( e )
2857
+ this . dirty_canvas = true
2858
+ return true
2859
+ }
2854
2860
2855
2861
#processWidgetClick(
2856
2862
e : CanvasPointerEvent ,
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ import _ from 'es-toolkit/compat'
2
2
import { type Component , toRaw } from 'vue'
3
3
4
4
import { useChainCallback } from '@/composables/functional/useChainCallback'
5
+ import type { CanvasPointer } from '@/lib/litegraph/src/CanvasPointer'
5
6
import {
7
+ LGraphCanvas ,
6
8
LGraphNode ,
7
9
LegacyWidget ,
8
10
LiteGraph
@@ -176,6 +178,13 @@ abstract class BaseDOMWidgetImpl<V extends object | string>
176
178
}
177
179
this . options . onDraw ?.( this )
178
180
}
181
+ override onPointerDown (
182
+ pointer : CanvasPointer ,
183
+ node : LGraphNode ,
184
+ canvas : LGraphCanvas
185
+ ) : boolean {
186
+ return canvas . passPointerEvent ( pointer , node )
187
+ }
179
188
180
189
override onRemove ( ) : void {
181
190
useDomWidgetStore ( ) . unregisterWidget ( this . id )
You can’t perform that action at this time.
0 commit comments