From 8c3d24434a66c8cc926fc7baefe5a7f35dcc0caa Mon Sep 17 00:00:00 2001 From: ssit Date: Tue, 20 Jun 2023 12:03:46 -0400 Subject: [PATCH] Fix overlapping when converting widgets to inputs --- web/extensions/core/widgetInputs.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/web/extensions/core/widgetInputs.js b/web/extensions/core/widgetInputs.js index c356655b..6b517496 100644 --- a/web/extensions/core/widgetInputs.js +++ b/web/extensions/core/widgetInputs.js @@ -59,6 +59,10 @@ function convertToInput(node, widget, config) { widget: { name: widget.name, config }, }); + for (const widget of node.widgets) { + widget.last_y += LiteGraph.NODE_SLOT_HEIGHT; + } + // Restore original size but grow if needed node.setSize([Math.max(sz[0], node.size[0]), Math.max(sz[1], node.size[1])]); } @@ -68,6 +72,10 @@ function convertToWidget(node, widget) { const sz = node.size; node.removeInput(node.inputs.findIndex((i) => i.widget?.name === widget.name)); + for (const widget of node.widgets) { + widget.last_y -= LiteGraph.NODE_SLOT_HEIGHT; + } + // Restore original size but grow if needed node.setSize([Math.max(sz[0], node.size[0]), Math.max(sz[1], node.size[1])]); }