Commit 8c3d2443 authored by ssit's avatar ssit
Browse files

Fix overlapping when converting widgets to inputs

parent 186f9204
...@@ -59,6 +59,10 @@ function convertToInput(node, widget, config) { ...@@ -59,6 +59,10 @@ function convertToInput(node, widget, config) {
widget: { name: widget.name, 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 // Restore original size but grow if needed
node.setSize([Math.max(sz[0], node.size[0]), Math.max(sz[1], node.size[1])]); node.setSize([Math.max(sz[0], node.size[0]), Math.max(sz[1], node.size[1])]);
} }
...@@ -68,6 +72,10 @@ function convertToWidget(node, widget) { ...@@ -68,6 +72,10 @@ function convertToWidget(node, widget) {
const sz = node.size; const sz = node.size;
node.removeInput(node.inputs.findIndex((i) => i.widget?.name === widget.name)); 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 // Restore original size but grow if needed
node.setSize([Math.max(sz[0], node.size[0]), Math.max(sz[1], node.size[1])]); node.setSize([Math.max(sz[0], node.size[0]), Math.max(sz[1], node.size[1])]);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment