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 9474f2d16..8695c3729 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 @@ -4437,6 +4437,7 @@ RED.view = (function() { } if (d.dirty || dirtyGroups[d.id]) { var g = d3.select(this); + var recalculateLabelOffsets = false; if (d.nodes.length > 0) { // If the group was just moved, all of its contents was // also moved - so no need to recalculate its bounding box @@ -4465,6 +4466,7 @@ RED.view = (function() { d.y = minY; d.w = maxX - minX; d.h = maxY - minY; + recalculateLabelOffsets = true; // if set explicitly to false, this group has just been // imported so needed this initial resize calculation. // Now that's done, delete the flag so the normal @@ -4478,28 +4480,31 @@ RED.view = (function() { } else { d.w = 40; d.h = 40; + recalculateLabelOffsets = true; } - if (!d.minWidth) { - if (d.style.label && d.name) { - var labelParts = getLabelParts(d.name||"","red-ui-flow-group-label"); - d.minWidth = labelParts.width + 8; - d.labels = labelParts.lines; - } else { - d.minWidth = 40; - d.labels = []; + if (recalculateLabelOffsets) { + if (!d.minWidth) { + if (d.style.label && d.name) { + var labelParts = getLabelParts(d.name||"","red-ui-flow-group-label"); + d.minWidth = labelParts.width + 8; + d.labels = labelParts.lines; + } else { + d.minWidth = 40; + d.labels = []; + } } - } - d.w = Math.max(d.minWidth,d.w); - if (d.style.label && d.labels.length > 0) { - var labelPos = d.style["label-position"] || "nw"; - var h = (d.labels.length-1) * 16; - if (labelPos[0] === "s") { - h += 8; - } - d.h += h; - if (labelPos[0] === "n") { - if (d.nodes.length > 0) { - d.y -= h; + d.w = Math.max(d.minWidth,d.w); + if (d.style.label && d.labels.length > 0) { + var labelPos = d.style["label-position"] || "nw"; + var h = (d.labels.length-1) * 16; + if (labelPos[0] === "s") { + h += 8; + } + d.h += h; + if (labelPos[0] === "n") { + if (d.nodes.length > 0) { + d.y -= h; + } } } }