custom widget custom size support

This commit is contained in:
altarfinch
2020-05-07 19:45:36 +02:00
parent 9fcc6c4975
commit 7ba41d1d75
4 changed files with 28534 additions and 3217 deletions

4
src/litegraph.d.ts vendored
View File

@@ -62,7 +62,7 @@ export interface IWidget<TValue = any, TOptions = any> {
width: number,
posY: number,
height: number
): void;
): number | undefined;
/**
* Called by `LGraphCanvas.processNodeWidgets`
* https://github.com/jagenjo/litegraph.js/issues/76
@@ -73,6 +73,8 @@ export interface IWidget<TValue = any, TOptions = any> {
pos: Vector2,
node: LGraphNode
): void;
/** Called by `LGraphNode.computeSize` */
computeSize?(width: number): [number, number];
}
export interface IButtonWidget extends IWidget<null, {}> {
type: "button";