mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-06 01:30:52 +08:00
部分连接线完成,另外待连接点红色区域显示。
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user