litegraph.js
litegraph.js copied to clipboard
Wrong and missing definitions for custom node appearance
@sha-N, I noticed some wrong definitions:
onDrawBackground?(
canvas: HTMLCanvasElement,
ctx: CanvasRenderingContext2D
): void;
onDrawForeground?(
canvas: HTMLCanvasElement,
ctx: CanvasRenderingContext2D
): void;
I believe the arguments are swapped, it should be:
onDrawBackground?(
ctx: CanvasRenderingContext2D,
canvas: HTMLCanvasElement
): void;
onDrawForeground?(
ctx: CanvasRenderingContext2D,
canvas: HTMLCanvasElement
): void;
Also, if one wants to reproduce the custom node appearance sample in TS, the definition for LGraphNode.flags.collapsed is missing.