连接线改成path绘制,方便绘制曲线

This commit is contained in:
akwkevin
2021-08-06 18:12:05 +08:00
parent e9c043ae3a
commit 8bec38e040
17 changed files with 494 additions and 124 deletions

View File

@@ -56,6 +56,10 @@ namespace Util.DiagramDesigner
{
bool flag;
Point n = GetNearestNeighborSource(source, endPoint, rectSource, rectSink, out flag, sourceInnerPoint);
if (linePoints.Contains(n))
{
break;
}
linePoints.Add(n);
currentPoint = n;
@@ -209,7 +213,7 @@ namespace Util.DiagramDesigner
return linePoints;
}
public List<Point> GetConnectionLine(ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool isInnerPoint = false)
public List<Point> GetConnectionLine(ConnectorInfo source, Point sinkPoint, ConnectorOrientation preferredOrientation, bool showLastLine, bool isInnerPoint = false)
{
List<Point> linePoints = new List<Point>();
int margin = isInnerPoint ? 0 : const_margin;
@@ -265,7 +269,7 @@ namespace Util.DiagramDesigner
else
linePoints = OptimizeLinePoints(linePoints, new Rect[] { rectSource }, source.Orientation, GetOpositeOrientation(source.Orientation));
if (!isInnerPoint)
if (!showLastLine)
{
linePoints.Insert(0, source.Position);
}