嗯,自动获取曲线方向

This commit is contained in:
艾竹
2023-02-16 23:02:43 +08:00
parent 968adb0635
commit 08a4fddfdc
3 changed files with 31 additions and 10 deletions

View File

@@ -69,7 +69,14 @@ namespace AIStudio.Wpf.DiagramDesigner
{
var cX = (route[0].X + route[1].X) / 2;
var cY = (route[0].Y + route[1].Y) / 2;
var curvePointA = GetCurvePoint(route[0].X, route[0].Y, cX, cY, link.SourceConnectorInfo?.Orientation);
var sourceOrientation = link.SourceConnectorInfo?.Orientation;
if (sourceOrientation == ConnectorOrientation.None)//按照线条的四象限来处理。
{
var slope = (route[1].Y - route[0].Y) / (route[1].X - route[0].X);
}
var curvePointA = GetCurvePoint(route[0].X, route[0].Y, cX, cY, sourceOrientation);
var curvePointB = GetCurvePoint(route[1].X, route[1].Y, cX, cY, link.SinkConnectorInfo?.Orientation);
return new[] { route[0], curvePointA, curvePointB, route[1] };
}