fixed handle connections
This commit is contained in:
@@ -38,7 +38,7 @@ export function getClosestHandle(
|
||||
let closestHandles: ConnectionHandle[] = [];
|
||||
let minDistance = Infinity;
|
||||
|
||||
handles.forEach((handle) => {
|
||||
for (const handle of handles) {
|
||||
const distance = Math.sqrt(Math.pow(handle.x - pos.x, 2) + Math.pow(handle.y - pos.y, 2));
|
||||
if (distance <= connectionRadius) {
|
||||
if (distance < minDistance) {
|
||||
@@ -49,7 +49,7 @@ export function getClosestHandle(
|
||||
}
|
||||
minDistance = distance;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!closestHandles.length) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user