diff --git a/src/components/WorkflowDesigner.tsx b/src/components/WorkflowDesigner.tsx index d413d2f..72d0f4b 100644 --- a/src/components/WorkflowDesigner.tsx +++ b/src/components/WorkflowDesigner.tsx @@ -478,36 +478,44 @@ export function WorkflowDesigner({ workflows, onWorkflowsChange }: WorkflowDesig y1 = sourceCenterY x2 = targetNode.position.x y2 = targetCenterY + } else { + x1 = sourceNode.position.x + y1 = sourceCenterY + x2 = targetNode.position.x + nodeWidth y2 = targetCenterY } const distance = Math.abs(dx) const offset = Math.min(50, distance / 4) controlOffset1X = dx > 0 ? offset : -offset - } - const distance = Math.abs(dx) - const offset = Math.min(50, distance / 4) - controlOffset1X = dx > 0 ? offset : -offset controlOffset1Y = 0 controlOffset2X = dx > 0 ? -offset : offset controlOffset2Y = 0 + } else { + if (dy > 0) { + x1 = sourceCenterX + y1 = sourceNode.position.y + nodeHeight x2 = targetCenterX y2 = targetNode.position.y } else { x1 = sourceCenterX y1 = sourceNode.position.y x2 = targetCenterX + y2 = targetNode.position.y + nodeHeight + } + const distance = Math.abs(dy) + const offset = Math.min(50, distance / 4) controlOffset1X = 0 controlOffset1Y = dy > 0 ? offset : -offset controlOffset2X = 0 controlOffset2Y = dy > 0 ? -offset : offset } - } - const distance = Math.abs(dy) - const offset = Math.min(50, distance / 4) - controlOffset1X = 0 - controlOffset1Y = dy > 0 ? offset : -offsetet1Y}, ${x2 + controlOffset2X} ${y2 + controlOffset2Y}, ${x2} ${y2}`} - controlOffset2X = 0 - controlOffset2Y = dy > 0 ? -offset : offset + + return ( + +