fix(selection): only calculate selection box if selected nodes > 0

This commit is contained in:
moklick
2022-06-16 13:33:36 +02:00
parent 6fbea44465
commit e03d6c23ec
2 changed files with 12 additions and 1 deletions
+4
View File
@@ -141,6 +141,10 @@ export const pointToRendererPoint = (
};
export const getRectOfNodes = (nodes: Node[]): Rect => {
if (nodes.length === 0) {
return { x: 0, y: 0, width: 0, height: 0 };
}
const box = nodes.reduce(
(currBox, { positionAbsolute, position, width, height }) =>
getBoundsOfBoxes(