修复旋转放大后 画线的问题

This commit is contained in:
艾竹
2023-02-11 10:03:06 +08:00
parent a928ae1ddd
commit 86082cb788
5 changed files with 308 additions and 11 deletions

View File

@@ -548,15 +548,15 @@ namespace AIStudio.Wpf.DiagramDesigner
var startMiddle = new RectangleBase
(
Math.Abs((PathGeneratorResult.SourceMarkerPosition.X + (source.Value.X - Area.Left)) / 2),
Math.Abs((PathGeneratorResult.SourceMarkerPosition.Y + (source.Value.Y - Area.Top)) / 2),
(PathGeneratorResult.SourceMarkerPosition.X + (source.Value.X - Area.Left)) / 2,
(PathGeneratorResult.SourceMarkerPosition.Y + (source.Value.Y - Area.Top)) / 2,
0,
0
);
var endMiddle = new RectangleBase
(
Math.Abs((PathGeneratorResult.TargetMarkerPosition.X + (target.Value.X - Area.Left)) / 2),
Math.Abs((PathGeneratorResult.TargetMarkerPosition.Y + (target.Value.Y - Area.Top)) / 2),
(PathGeneratorResult.TargetMarkerPosition.X + (target.Value.X - Area.Left)) / 2,
(PathGeneratorResult.TargetMarkerPosition.Y + (target.Value.Y - Area.Top)) / 2,
0,
0
);
@@ -589,8 +589,8 @@ namespace AIStudio.Wpf.DiagramDesigner
if (SourceConnectorInfo.DataItem == null || (IsFullConnection && SinkConnectorInfoFully.DataItem == null))
return (null, null);
var sourceCenter = SourceConnectorInfo.IsPortless ? SourceConnectorInfo.DataItem.GetBounds().Center : SourceConnectorInfo.MiddlePosition;
var targetCenter = SinkConnectorInfoFully?.IsPortless == true ? SinkConnectorInfoFully?.DataItem?.GetBounds().Center ?? OnGoingPosition : SinkConnectorInfoFully?.MiddlePosition ?? OnGoingPosition;
var sourceCenter = SourceConnectorInfo.IsPortless ? SourceConnectorInfo.DataItem.MiddlePosition : SourceConnectorInfo.MiddlePosition;
var targetCenter = SinkConnectorInfoFully?.IsPortless == true ? SinkConnectorInfoFully?.DataItem?.MiddlePosition ?? OnGoingPosition : SinkConnectorInfoFully?.MiddlePosition ?? OnGoingPosition;
var firstPt = route.Length > 0 ? route[0] : targetCenter;
var secondPt = route.Length > 0 ? route[0] : sourceCenter;
var sourceLine = new LineBase(firstPt, sourceCenter);