部分连接线完成,另外待连接点红色区域显示。

This commit is contained in:
艾竹
2023-05-03 16:00:34 +08:00
parent ed22b9daa3
commit 6b13f51814
19 changed files with 933 additions and 53 deletions

View File

@@ -448,12 +448,6 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
public void RaiseFullConnection()
{
RaisePropertyChanged(nameof(IsFullConnection));
}
public double SmoothMargin { get; set; } = 125;
public double SmoothAutoSlope { get; set; } = 1;
public double OrthogonalShapeMargin { get; set; } = 10;
@@ -585,13 +579,13 @@ namespace AIStudio.Wpf.DiagramDesigner
}
else if(connectorVertexModel.ConnectorVertexType == ConnectorVertexType.Start)
{
var nearPort = Root.FindNearPortToAttachTo(this, ConnectorVertexType.Start);
SetSourcePort(new PartCreatedConnectorInfo(connectorVertexModel.Position.X, connectorVertexModel.Position.Y));
this.ZIndex = -1;
}
else if (connectorVertexModel.ConnectorVertexType == ConnectorVertexType.End)
{
var nearPort = Root.FindNearPortToAttachTo(this, ConnectorVertexType.End);
SetSinkPort(new PartCreatedConnectorInfo(connectorVertexModel.Position.X, connectorVertexModel.Position.Y));
this.ZIndex = -1;
}
break;
case nameof(ConnectorPointModel.DragStart):
@@ -599,7 +593,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{
if (connectorVertexModel.ConnectorVertexType == ConnectorVertexType.Start)
{
var nearPort = Root.FindNearPortToAttachTo(this, ConnectorVertexType.Start);
var nearPort = Root?.FindNearPortToAttachTo(this, ConnectorVertexType.Start);
if (nearPort != null)
{
SetSourcePort(nearPort);
@@ -607,12 +601,13 @@ namespace AIStudio.Wpf.DiagramDesigner
}
else if (connectorVertexModel.ConnectorVertexType == ConnectorVertexType.End)
{
var nearPort = Root.FindNearPortToAttachTo(this, ConnectorVertexType.End);
var nearPort = Root?.FindNearPortToAttachTo(this, ConnectorVertexType.End);
if (nearPort != null)
{
SetSinkPort(nearPort);
}
}
Root?.ClearNearPort();
}
break;
}
@@ -895,7 +890,7 @@ namespace AIStudio.Wpf.DiagramDesigner
public double GetSourceMarkerWidth()
{
if (!IsFullConnection || string.IsNullOrEmpty(ShapeViewModel.SourceMarker.Path))
if (string.IsNullOrEmpty(ShapeViewModel.SourceMarker.Path))
{
return 0;
}
@@ -904,7 +899,7 @@ namespace AIStudio.Wpf.DiagramDesigner
public double GetSourceMarkerHeight()
{
if (!IsFullConnection || string.IsNullOrEmpty(ShapeViewModel.SourceMarker.Path))
if (string.IsNullOrEmpty(ShapeViewModel.SourceMarker.Path))
{
return 0;
}
@@ -913,7 +908,7 @@ namespace AIStudio.Wpf.DiagramDesigner
public double GetSinkMarkerWidth()
{
if (!IsFullConnection || string.IsNullOrEmpty(ShapeViewModel.SinkMarker.Path))
if (string.IsNullOrEmpty(ShapeViewModel.SinkMarker.Path))
{
return 0;
}
@@ -922,7 +917,7 @@ namespace AIStudio.Wpf.DiagramDesigner
public double GetSinkMarkerHeight()
{
if (!IsFullConnection || string.IsNullOrEmpty(ShapeViewModel.SinkMarker.Path))
if (string.IsNullOrEmpty(ShapeViewModel.SinkMarker.Path))
{
return 0;
}