diff --git a/src/LGraphCanvas.ts b/src/LGraphCanvas.ts index 1f8aef151..eb9c3ee89 100644 --- a/src/LGraphCanvas.ts +++ b/src/LGraphCanvas.ts @@ -1929,9 +1929,12 @@ export class LGraphCanvas implements ConnectionColorContext { for (const widget of node.widgets) { if (widget.hidden || (widget.advanced && !node.showAdvanced)) continue - let widgetWidth, widgetHeight + let widgetWidth: number, widgetHeight: number if (widget.computeSize) { ([widgetWidth, widgetHeight] = widget.computeSize(node.size[0])) + } else if (widget.computeLayoutSize) { + widgetWidth = widget.width + widgetHeight = widget.computedHeight } else { widgetWidth = widget.width || node.size[0] widgetHeight = LiteGraph.NODE_WIDGET_HEIGHT diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index 76e18d758..0e0f041ad 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -1898,9 +1898,10 @@ export class LGraphNode implements Positionable, IPinnable, IColorable { continue } - const h = widget.computeSize - ? widget.computeSize(nodeWidth)[1] - : LiteGraph.NODE_WIDGET_HEIGHT + const h = widget.computedHeight ?? + widget.computeSize?.(nodeWidth)[1] ?? + LiteGraph.NODE_WIDGET_HEIGHT + const w = widget.width || nodeWidth if ( widget.last_y !== undefined &&