fix NodeSelection appearing when no nodes are selected

This commit is contained in:
peterkogo
2025-10-28 14:11:20 +01:00
parent 2baa839138
commit 082801bb30

View File

@@ -31,7 +31,12 @@
if (store.selectionRectMode === 'nodes') {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
store.nodes;
return getInternalNodesBounds(store.nodeLookup, { filter: (node) => !!node.selected });
const nodeBounds = getInternalNodesBounds(store.nodeLookup, {
filter: (node) => !!node.selected
});
if (nodeBounds.width > 0 && nodeBounds.height > 0) {
return nodeBounds;
}
}
return null;
});