optimized selection via selectionbox, implemented proper defaultEdge/-NodeOptions

This commit is contained in:
peterkogo
2024-12-19 17:33:16 +01:00
parent 19e233af2d
commit 6349290722
10 changed files with 78 additions and 60 deletions
+3 -2
View File
@@ -202,7 +202,8 @@ export const getNodesInside = <NodeType extends NodeBase = NodeBase>(
[tx, ty, tScale]: Transform = [0, 0, 1],
partially = false,
// set excludeNonSelectableNodes if you want to pay attention to the nodes "selectable" attribute
excludeNonSelectableNodes = false
excludeNonSelectableNodes = false,
defaultNodeSelectable: boolean = true
): InternalNodeBase<NodeType>[] => {
const paneRect = {
...pointToRendererPoint(rect, [tx, ty, tScale]),
@@ -213,7 +214,7 @@ export const getNodesInside = <NodeType extends NodeBase = NodeBase>(
const visibleNodes: InternalNodeBase<NodeType>[] = [];
for (const node of nodes.values()) {
const { measured, selectable = true, hidden = false } = node;
const { measured, selectable = defaultNodeSelectable, hidden = false } = node;
if ((excludeNonSelectableNodes && !selectable) || hidden) {
continue;