From 76f4d65d79639b342750fcc3c459b819eb05f68f Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 22 Mar 2023 18:50:45 +0000 Subject: [PATCH] Remove initial call as now unnecessary Set canvas to dirty if we grow the node --- web/scripts/widgets.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web/scripts/widgets.js b/web/scripts/widgets.js index f822e9fa..ee7b5d3d 100644 --- a/web/scripts/widgets.js +++ b/web/scripts/widgets.js @@ -62,6 +62,7 @@ function addMultilineWidget(node, name, opts, app) { // There isnt enough space for all the widgets, increase the size of the node freeSpace = MIN_SIZE; node.size[1] = y + widgetHeight + freeSpace * multi.length; + node.graph.setDirtyCanvas(true); } // Position each of the widgets @@ -151,7 +152,7 @@ function addMultilineWidget(node, name, opts, app) { if (!(MultilineSymbol in node)) { node[MultilineSymbol] = true; const onResize = node.onResize; - + node.onResize = function (size) { computeSize(size); @@ -160,11 +161,6 @@ function addMultilineWidget(node, name, opts, app) { onResize.apply(this, arguments); } }; - - requestAnimationFrame(() => { - computeSize(node.size); - app.graph.setDirtyCanvas(true); - }); } return { minWidth: 400, minHeight: 200, widget };