fixed handle connections
This commit is contained in:
@@ -223,9 +223,14 @@ svg.xy-flow__connectionline {
|
||||
min-width: 5px;
|
||||
min-height: 5px;
|
||||
|
||||
&.connecting {
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
&.connectionindicator {
|
||||
pointer-events: all;
|
||||
cursor: crosshair;
|
||||
background: green;
|
||||
}
|
||||
|
||||
&-bottom {
|
||||
|
||||
@@ -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