optimized selection via selectionbox, implemented proper defaultEdge/-NodeOptions
This commit is contained in:
@@ -36,5 +36,5 @@ export type HandleProps = {
|
||||
/** Id of the handle
|
||||
* @remarks optional if there is only one handle of this type
|
||||
*/
|
||||
id?: string;
|
||||
id?: string | null;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user