Skip to content

Commit 393e9d8

Browse files
committed
Fix crash if element is hidden
1 parent dd09723 commit 393e9d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/js/workflowImage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,10 @@ app.registerExtension({
558558
const x = config.x;
559559
const y = config.y;
560560
const domWrapper = this.inputEl.closest(".dom-widget") ?? widget.inputEl;
561-
const w = parseInt(domWrapper.style.width);
561+
let w = parseInt(domWrapper.style.width);
562+
if (w === 0) {
563+
w = this.node.size[0] - 20;
564+
}
562565
const h = parseInt(domWrapper.style.height);
563566
ctx.fillStyle = style.getPropertyValue("background-color");
564567
ctx.fillRect(x, y, w, h);

0 commit comments

Comments
 (0)