diff --git a/src/pages/flowEditor/components/customEdge.tsx b/src/pages/flowEditor/components/customEdge.tsx index be0d343..9bbf62a 100644 --- a/src/pages/flowEditor/components/customEdge.tsx +++ b/src/pages/flowEditor/components/customEdge.tsx @@ -1,27 +1,28 @@ import React from 'react'; -import { BaseEdge, EdgeLabelRenderer, EdgeProps, getBezierPath, useReactFlow } from '@xyflow/react'; -import EdgeAddNodeButton from './edgeAddNodeButton'; +import { BaseEdge, EdgeLabelRenderer, EdgeProps, getSmoothStepPath, useReactFlow } from '@xyflow/react'; +import EdgeAddNodeButton from '@/pages/flowEditor/components/edgeAddNodeButton'; const CustomEdge: React.FC = ({ - id, - sourceX, - sourceY, - targetX, - targetY, - sourcePosition, - targetPosition, - style = {}, - markerEnd, - selected, - data - }) => { - const [edgePath, labelX, labelY, offsetX, offsetY] = getBezierPath({ + id, + sourceX, + sourceY, + targetX, + targetY, + sourcePosition, + targetPosition, + style = {}, + markerEnd, + selected, + data +}) => { + const [edgePath, labelX, labelY] = getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, - targetPosition + targetPosition, + borderRadius: 8, // 设置圆角半径 }); // 从数据中获取悬停状态