From 393e9d8df5dc030af14bbd52941c2704ff9ef82b Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 30 Apr 2025 12:59:34 +0100 Subject: [PATCH] Fix crash if element is hidden --- web/js/workflowImage.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/js/workflowImage.js b/web/js/workflowImage.js index 16838e3..37c3ad0 100644 --- a/web/js/workflowImage.js +++ b/web/js/workflowImage.js @@ -558,7 +558,10 @@ app.registerExtension({ const x = config.x; const y = config.y; const domWrapper = this.inputEl.closest(".dom-widget") ?? widget.inputEl; - const w = parseInt(domWrapper.style.width); + let w = parseInt(domWrapper.style.width); + if (w === 0) { + w = this.node.size[0] - 20; + } const h = parseInt(domWrapper.style.height); ctx.fillStyle = style.getPropertyValue("background-color"); ctx.fillRect(x, y, w, h);