Merge branch 'widget-input-overlapping' of https://github.com/ssitu/ComfyUI

This commit is contained in:
comfyanonymous 2023-06-21 02:45:59 -04:00
commit 852cf4db99
1 changed files with 8 additions and 0 deletions

View File

@ -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])]);
}