File tree Expand file tree Collapse file tree 3 files changed +5
-32
lines changed
tests-ui/tests/litegraph/core Expand file tree Collapse file tree 3 files changed +5
-32
lines changed Original file line number Diff line number Diff line change @@ -743,35 +743,6 @@ export class LGraphNode
743
743
error : this . #getErrorStrokeStyle,
744
744
selected : this . #getSelectedStrokeStyle
745
745
}
746
-
747
- // Assign onMouseDown implementation
748
- this . onMouseDown = (
749
- // @ts -expect-error - CanvasPointerEvent type needs fixing
750
- e : CanvasPointerEvent ,
751
- pos : Point ,
752
- canvas : LGraphCanvas
753
- ) : boolean => {
754
- // Check for title button clicks (only if not collapsed)
755
- if ( this . title_buttons ?. length && ! this . flags . collapsed ) {
756
- // pos contains the offset from the node's position, so we need to use node-relative coordinates
757
- const nodeRelativeX = pos [ 0 ]
758
- const nodeRelativeY = pos [ 1 ]
759
-
760
- for ( let i = 0 ; i < this . title_buttons . length ; i ++ ) {
761
- const button = this . title_buttons [ i ]
762
- if (
763
- button . visible &&
764
- button . isPointInside ( nodeRelativeX , nodeRelativeY )
765
- ) {
766
- this . onTitleButtonClick ( button , canvas )
767
- return true // Prevent default behavior
768
- }
769
- }
770
- }
771
-
772
- return false // Allow default behavior
773
- }
774
-
775
746
// Initialize property manager with tracked properties
776
747
this . changeTracker = new LGraphNodeProperties ( this )
777
748
}
Original file line number Diff line number Diff line change @@ -621,5 +621,10 @@ describe('LGraphNode', () => {
621
621
expect ( node . getInputSlotPos ( inputSlot ) ) . toEqual ( [ expectedX , expectedY ] )
622
622
delete ( node . constructor as any ) . slot_start_y
623
623
} )
624
+ test ( 'should not overwrite onMouseDown prototype' , ( ) => {
625
+ expect ( Object . prototype . hasOwnProperty . call ( node , 'onMouseDown' ) ) . toEqual (
626
+ false
627
+ )
628
+ } )
624
629
} )
625
630
} )
Original file line number Diff line number Diff line change @@ -84,7 +84,6 @@ LGraph {
84
84
" lostFocusAt" : undefined ,
85
85
" mode" : 0 ,
86
86
" mouseOver" : undefined ,
87
- " onMouseDown" : [Function ],
88
87
" order" : 0 ,
89
88
" outputs" : [],
90
89
" progress" : undefined ,
@@ -157,7 +156,6 @@ LGraph {
157
156
" lostFocusAt" : undefined ,
158
157
" mode" : 0 ,
159
158
" mouseOver" : undefined ,
160
- " onMouseDown" : [Function ],
161
159
" order" : 0 ,
162
160
" outputs" : [],
163
161
" progress" : undefined ,
@@ -231,7 +229,6 @@ LGraph {
231
229
" lostFocusAt" : undefined ,
232
230
" mode" : 0 ,
233
231
" mouseOver" : undefined ,
234
- " onMouseDown" : [Function ],
235
232
" order" : 0 ,
236
233
" outputs" : [],
237
234
" progress" : undefined ,
You can’t perform that action at this time.
0 commit comments