1
1
import { app , ANIM_PREVIEW_WIDGET } from "./app.js" ;
2
- import { LGraphCanvas , LGraphNode , LiteGraph } from "/lib /litegraph.core.js " ;
3
- import type { LGraphNode as LGraphNodeType , Vector4 } from "/types/litegraph.js" ;
2
+ import type { LGraphNode , Vector4 } from "/types /litegraph" ;
3
+
4
4
5
5
const SIZE = Symbol ( ) ;
6
6
@@ -21,7 +21,7 @@ interface DOMWidget {
21
21
value ?: any ;
22
22
y ?: number ;
23
23
callback ?: ( value : any ) => void ;
24
- draw ?: ( ctx : CanvasRenderingContext2D , node : LGraphNodeType , widgetWidth : number , y : number , widgetHeight : number ) => void ;
24
+ draw ?: ( ctx : CanvasRenderingContext2D , node : LGraphNode , widgetWidth : number , y : number , widgetHeight : number ) => void ;
25
25
onRemove ?: ( ) => void ;
26
26
}
27
27
@@ -35,8 +35,8 @@ function intersect(a: Rect, b: Rect): Vector4 | null {
35
35
else return null ;
36
36
}
37
37
38
- function getClipPath ( node : LGraphNodeType , element : HTMLElement ) : string {
39
- const selectedNode : LGraphNodeType = Object . values ( app . canvas . selected_nodes ) [ 0 ] as LGraphNodeType ;
38
+ function getClipPath ( node : LGraphNode , element : HTMLElement ) : string {
39
+ const selectedNode : LGraphNode = Object . values ( app . canvas . selected_nodes ) [ 0 ] as LGraphNode ;
40
40
if ( selectedNode && selectedNode !== node ) {
41
41
const elRect = element . getBoundingClientRect ( ) ;
42
42
const MARGIN = 7 ;
@@ -194,7 +194,7 @@ function computeSize(size: [number, number]): void {
194
194
// Override the compute visible nodes function to allow us to hide/show DOM elements when the node goes offscreen
195
195
const elementWidgets = new Set ( ) ;
196
196
const computeVisibleNodes = LGraphCanvas . prototype . computeVisibleNodes ;
197
- LGraphCanvas . prototype . computeVisibleNodes = function ( ) : LGraphNodeType [ ] {
197
+ LGraphCanvas . prototype . computeVisibleNodes = function ( ) : LGraphNode [ ] {
198
198
const visibleNodes = computeVisibleNodes . apply ( this , arguments ) ;
199
199
for ( const node of app . graph . _nodes ) {
200
200
if ( elementWidgets . has ( node ) ) {
@@ -260,7 +260,7 @@ LGraphNode.prototype.addDOMWidget = function (
260
260
options . setValue ?.( v ) ;
261
261
widget . callback ?.( widget . value ) ;
262
262
} ,
263
- draw : function ( ctx : CanvasRenderingContext2D , node : LGraphNodeType , widgetWidth : number , y : number , widgetHeight : number ) {
263
+ draw : function ( ctx : CanvasRenderingContext2D , node : LGraphNode , widgetWidth : number , y : number , widgetHeight : number ) {
264
264
if ( widget . computedHeight == null ) {
265
265
computeSize . call ( node , node . size ) ;
266
266
}
0 commit comments