|
@ -156,7 +156,7 @@ class SelectionHandler { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Get the top node at the a specific point (like a click) |
|
|
|
|
|
|
|
|
* Get the top node at the passed point (like a click) |
|
|
* |
|
|
* |
|
|
* @param {{x: Number, y: Number}} pointer |
|
|
* @param {{x: Number, y: Number}} pointer |
|
|
* @return {Node | undefined} node |
|
|
* @return {Node | undefined} node |
|
@ -212,11 +212,10 @@ class SelectionHandler { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Place holder. To implement change the getNodeAt to a _getObjectAt. Have the _getObjectAt call |
|
|
|
|
|
* getNodeAt and _getEdgesAt, then priortize the selection to user preferences. |
|
|
|
|
|
|
|
|
* Get the edges nearest to the passed point (like a click) |
|
|
* |
|
|
* |
|
|
* @param pointer |
|
|
|
|
|
* @returns {undefined} |
|
|
|
|
|
|
|
|
* @param {{x: Number, y: Number}} pointer |
|
|
|
|
|
* @return {Edge | undefined} node |
|
|
*/ |
|
|
*/ |
|
|
getEdgeAt(pointer, returnEdge = true) { |
|
|
getEdgeAt(pointer, returnEdge = true) { |
|
|
// Iterate over edges, pick closest within 10
|
|
|
// Iterate over edges, pick closest within 10
|
|
@ -239,7 +238,7 @@ class SelectionHandler { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (overlappingEdge) { |
|
|
|
|
|
|
|
|
if (overlappingEdge !== null) { |
|
|
if (returnEdge === true) { |
|
|
if (returnEdge === true) { |
|
|
return this.body.edges[overlappingEdge]; |
|
|
return this.body.edges[overlappingEdge]; |
|
|
} |
|
|
} |
|
@ -706,4 +705,4 @@ class SelectionHandler { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
export default SelectionHandler; |
|
|
|
|
|
|
|
|
export default SelectionHandler; |