diff --git a/packages/system/src/utils/graph.ts b/packages/system/src/utils/graph.ts index 1b7d27d1..ab68ae72 100644 --- a/packages/system/src/utils/graph.ts +++ b/packages/system/src/utils/graph.ts @@ -241,25 +241,16 @@ export const getInternalNodesBounds = , params: GetInternalNodesBoundsParams = {} ): Rect => { - const emptyRect = { x: 0, y: 0, width: 0, height: 0 }; - - if (nodeLookup.size === 0) { - return emptyRect; - } - - let box = { x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity }; - - let hasVisibleNodes = false; + let box = { x: 0, y: 0, x2: 0, y2: 0 }; nodeLookup.forEach((node) => { if (params.filter === undefined || params.filter(node)) { - hasVisibleNodes = true; const nodeBox = nodeToBox(node as InternalNodeBase); box = getBoundsOfBoxes(box, nodeBox); } }); - return hasVisibleNodes ? boxToRect(box) : emptyRect; + return boxToRect(box); }; export const getNodesInside = (