Skip to content

Commit 4df6153

Browse files
committed
Fix connection edge drawn incorrectly
1 parent 17d15e2 commit 4df6153

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/agentflow/src/features/canvas/components/NodeOutputHandles.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ function NodeOutputHandlesComponent({ outputAnchors, nodeColor, isHovered, nodeR
6161
}, [nodeRef, nodeId, updateNodeInternals])
6262

6363
const getAnchorPosition = (index: number) => {
64-
const spacing = nodeHeight / (outputAnchors.length + 1)
64+
// Use measured nodeHeight if available, otherwise fallback to minimum calculated height
65+
// This ensures handles are positioned correctly even before ResizeObserver fires
66+
const effectiveHeight = nodeHeight > 0 ? nodeHeight : getMinimumNodeHeight(outputAnchors.length)
67+
const spacing = effectiveHeight / (outputAnchors.length + 1)
6568
return spacing * (index + 1)
6669
}
6770

0 commit comments

Comments
 (0)