refactor(xydrag): cleanup

This commit is contained in:
moklick
2024-04-16 18:22:07 +02:00
parent f242494b29
commit 3348194dea
6 changed files with 21 additions and 25 deletions
-4
View File
@@ -1,9 +1,5 @@
import { type NodeDragItem, type XYPosition, InternalNodeBase, NodeBase, NodeLookup } from '../types';
export function wrapSelectionDragFunc(selectionFunc?: (event: MouseEvent, nodes: NodeBase[]) => void) {
return (event: MouseEvent, _: NodeBase, nodes: NodeBase[]) => selectionFunc?.(event, nodes);
}
export function isParentSelected<NodeType extends NodeBase>(node: NodeType, nodeLookup: NodeLookup): boolean {
if (!node.parentId) {
return false;