[Refactor] Generalize dom widget layout as Widget.computeLayoutSize hook (#2547)

This commit is contained in:
Chenlei Hu
2025-02-13 14:30:46 -05:00
committed by GitHub
parent 174754e646
commit 166ad432f3
2 changed files with 59 additions and 45 deletions

View File

@@ -30,6 +30,19 @@ declare module '@comfyorg/litegraph/dist/types/widgets' {
* See scripts/domWidget.ts for more details.
*/
computedHeight?: number
/**
* Compute the layout size of the widget. Overrides {@link IBaseWidget.computeSize}.
*/
computeLayoutSize?: (
this: IBaseWidget,
node: LGraphNode
) => {
minHeight: number
maxHeight?: number
minWidth: number
maxWidth?: number
}
}
}