Merge pull request #517 from wbkd/develop

Develop
This commit is contained in:
Moritz
2020-09-18 12:50:18 +02:00
committed by GitHub
3 changed files with 3 additions and 9 deletions
+1 -1
View File
@@ -586,7 +586,7 @@ Returns all direct child nodes of the passed node.
Returns all direct incoming nodes of the passed node.
`getOutgoers = (node: Node, elements: Elements): Node[]`
`getIncomers = (node: Node, elements: Elements): Node[]`
### getConnectedEdges
+1 -7
View File
@@ -2,7 +2,7 @@
* The user selection rectangle gets displayed when a user drags the mouse while pressing shift
*/
import React, { memo, useEffect } from 'react';
import React, { memo } from 'react';
import { useStoreActions, useStoreState } from '../../store/hooks';
import { XYPosition } from '../../types';
@@ -53,12 +53,6 @@ export default memo(({ selectionKeyPressed }: UserSelectionProps) => {
const unsetUserSelection = useStoreActions((actions) => actions.unsetUserSelection);
const renderUserSelectionPane = selectionActive || selectionKeyPressed;
useEffect(() => {
if (!selectionKeyPressed) {
unsetUserSelection();
}
}, [selectionKeyPressed]);
if (!elementsSelectable || !renderUserSelectionPane) {
return null;
}
+1 -1
View File
@@ -157,7 +157,7 @@ export const getBoundsofRects = (rect1: Rect, rect2: Rect): Rect =>
export const getRectOfNodes = (nodes: Node[]): Rect => {
const box = nodes.reduce(
(currBox, { __rf: { position, width, height } }) =>
(currBox, { __rf: { position, width, height } = {} }) =>
getBoundsOfBoxes(currBox, rectToBox({ ...position, width, height })),
{ x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity }
);