refactor(core): find handle by id regardless of num of handles
This commit is contained in:
@@ -37,13 +37,7 @@ export function getHandle(bounds: HandleElement[] = [], handleId?: string | null
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!handleId || bounds.length === 1) {
|
return (!handleId ? bounds[0] : bounds.find((d) => d.id === handleId)) || null
|
||||||
return bounds[0]
|
|
||||||
} else if (handleId) {
|
|
||||||
return bounds.find((d) => d.id === handleId) || null
|
|
||||||
}
|
|
||||||
|
|
||||||
return null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getEdgePositions(
|
export function getEdgePositions(
|
||||||
|
|||||||
Reference in New Issue
Block a user