mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-11 19:56:36 +08:00
部分连接线拖拽完成
This commit is contained in:
@@ -33,8 +33,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
private static PointBase[] GetRouteWithMiddlePoints(IDiagramViewModel _, ConnectionViewModel link, PointBase[] route)
|
||||
{
|
||||
var middle = GetMiddlePoints(
|
||||
link.SourceConnectorInfo.MiddlePosition,
|
||||
link.SourceConnectorInfo.Orientation,
|
||||
link.SourceConnectorInfoFully.MiddlePosition,
|
||||
link.SourceConnectorInfoFully.Orientation,
|
||||
link.SinkConnectorInfo.MiddlePosition,
|
||||
link.IsFullConnection ? link.SinkConnectorInfoFully.Orientation : (link.SinkConnectorInfo.MiddlePosition.Y >= link.SourceConnectorInfo.MiddlePosition.Y ? ConnectorOrientation.Top : ConnectorOrientation.Bottom),
|
||||
_.GridCellSize,
|
||||
|
||||
@@ -37,10 +37,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private static PointBase[] GetRouteWithFullConnectionLine(IDiagramViewModel _, ConnectionViewModel link, PointBase[] route)
|
||||
{
|
||||
var sourceInnerPoint = link.SourceConnectorInfo.IsInnerPoint;
|
||||
PointBase sourcePoint = link.SourceConnectorInfo.MiddlePosition;
|
||||
var sourceInnerPoint = link.SourceConnectorInfoFully.IsInnerPoint;
|
||||
PointBase sourcePoint = link.SourceConnectorInfoFully.MiddlePosition;
|
||||
PointBase sinkPoint = link.SinkConnectorInfo.MiddlePosition;
|
||||
ConnectorOrientation sourceOrientation = link.SourceConnectorInfo.Orientation;
|
||||
ConnectorOrientation sourceOrientation = link.SourceConnectorInfoFully.Orientation;
|
||||
ConnectorOrientation sinkOrientation = link.SinkConnectorInfoFully.Orientation;
|
||||
|
||||
List<PointBase> linePoints = new List<PointBase>();
|
||||
@@ -242,7 +242,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private static PointBase[] GetRouteWithPartConnectionLine(IDiagramViewModel diagramViewModel, ConnectionViewModel link, PointBase[] route)
|
||||
{
|
||||
var sourceInnerPoint = link.SourceConnectorInfo.IsInnerPoint;
|
||||
var sourceInnerPoint = link.SourceConnectorInfoFully?.IsInnerPoint ?? false;
|
||||
PointBase sourcePoint = link.SourceConnectorInfo.MiddlePosition;
|
||||
PointBase sinkPoint = link.SinkConnectorInfo.MiddlePosition;
|
||||
ConnectorOrientation sourceOrientation = link.SourceConnectorInfo.Orientation;
|
||||
@@ -301,8 +301,8 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
linePoints = OptimizeLinePoints(linePoints, new RectangleBase[] { rectSource }, sourceOrientation, preferredOrientation);
|
||||
else
|
||||
linePoints = OptimizeLinePoints(linePoints, new RectangleBase[] { rectSource }, sourceOrientation, GetOpositeOrientation(sourceOrientation));
|
||||
|
||||
linePoints.Insert(0, sourcePoint);
|
||||
|
||||
linePoints.Insert(0, sourcePoint);
|
||||
|
||||
return linePoints.ToArray();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var cX = (route[0].X + route[1].X) / 2;
|
||||
var cY = (route[0].Y + route[1].Y) / 2;
|
||||
|
||||
var sourceOrientation = 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);
|
||||
|
||||
Reference in New Issue
Block a user