From d43cff21055fdd0054acba075cea19740bca69da Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Sat, 8 Jul 2023 01:42:33 +0900 Subject: [PATCH] bugfix: image widget's was mis-aligned when node has multiline widget --- web/scripts/app.js | 6 +++++- web/scripts/widgets.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/scripts/app.js b/web/scripts/app.js index 09310c7f..bf424058 100644 --- a/web/scripts/app.js +++ b/web/scripts/app.js @@ -368,7 +368,11 @@ export class ComfyApp { shiftY = w.last_y; if (w.computeSize) { shiftY += w.computeSize()[1] + 4; - } else { + } + else if(w.computedHeight) { + shiftY += w.computedHeight; + } + else { shiftY += LiteGraph.NODE_WIDGET_HEIGHT + 4; } } else { diff --git a/web/scripts/widgets.js b/web/scripts/widgets.js index dfa26aef..89d4a2e3 100644 --- a/web/scripts/widgets.js +++ b/web/scripts/widgets.js @@ -129,6 +129,7 @@ function addMultilineWidget(node, name, opts, app) { w.y = y; if (w.type === "customtext") { y += freeSpace; + w.computedHeight = freeSpace - multi.length*4; } else if (w.computeSize) { y += w.computeSize()[1] + 4; } else {