From 4dd68452b4001bbac9890a170ec73474fcad8124 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 16 Jun 2020 20:23:18 +0100 Subject: [PATCH] Prevent node creep when switching tabs --- .../node_modules/@node-red/editor-client/src/js/ui/view.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js index f6894164e..496159b30 100755 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/view.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/view.js @@ -3528,7 +3528,6 @@ RED.view = (function() { var isLink = (d.type === "link in" || d.type === "link out") var hideLabel = d.hasOwnProperty('l')?!d.l : isLink; node.attr("id",d.id); - d.w = node_height; d.h = node_height; d.resize = true; @@ -3722,8 +3721,9 @@ RED.view = (function() { } else { d.w = Math.max(node_width,20*(Math.ceil((labelParts.width+50+(d._def.inputs>0?7:0))/20)) ); } - // d.w = Math.max(node_width,20*(Math.ceil((calculateTextWidth(l, "red-ui-flow-node-label", 50)+(d._def.inputs>0?7:0))/20)) ); - d.x += (d.w-ow)/2; + if (ow !== undefined) { + d.x += (d.w-ow)/2; + } d.resize = false; }