mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
画线调整
This commit is contained in:
@@ -37,6 +37,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
private void Init(FullyCreatedConnectorInfo sourceConnectorInfo, ConnectorInfoBase sinkConnectorInfo)
|
||||
{
|
||||
this.Parent = sourceConnectorInfo.DataItem.Parent;
|
||||
if (Parent != null && Parent.ColorViewModel != null)
|
||||
{
|
||||
this.ColorViewModel = CopyHelper.Mapper(Parent.ColorViewModel);
|
||||
}
|
||||
if (sinkConnectorInfo is FullyCreatedConnectorInfo sink && sink.DataItem.ShowArrow == false)
|
||||
{
|
||||
this.ColorViewModel.RightArrowPathStyle = ArrowPathStyle.None;
|
||||
}
|
||||
|
||||
var routetype = GlobalType.AllTypes.Where(p => typeof(IRouter).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == RouterMode);
|
||||
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
|
||||
@@ -47,16 +55,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
this.SourceConnectorInfo = sourceConnectorInfo;
|
||||
this.SinkConnectorInfo = sinkConnectorInfo;
|
||||
DeleteConnectionCommand = new SimpleCommand(DeleteConnection);
|
||||
AddVertexCommand = new SimpleCommand(AddVertex);
|
||||
|
||||
if (Parent != null && Parent.ColorViewModel != null)
|
||||
{
|
||||
this.ColorViewModel = CopyHelper.Mapper(Parent.ColorViewModel);
|
||||
}
|
||||
if (sinkConnectorInfo is FullyCreatedConnectorInfo sink && sink.DataItem.ShowArrow == false)
|
||||
{
|
||||
this.ColorViewModel.RightArrowPathStyle = ArrowPathStyle.None;
|
||||
}
|
||||
AddVertexCommand = new SimpleCommand(AddVertex);
|
||||
}
|
||||
|
||||
public override SelectableDesignerItemBase ToXmlObject()
|
||||
@@ -352,12 +351,13 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var route = Router.Get(Parent, this);
|
||||
|
||||
(var source, var target) = FindConnectionPoints(route);
|
||||
if (source == null || target == null)
|
||||
return;
|
||||
if (source == null || target == null)
|
||||
return;
|
||||
|
||||
PathGeneratorResult = PathGenerator.Get(Parent, this, route, source.Value, target.Value);
|
||||
StartPoint = PathGeneratorResult.SourceMarkerPosition;
|
||||
EndPoint = PathGeneratorResult.TargetMarkerPosition;
|
||||
|
||||
StartPoint = new PointBase(source.Value.X - Area.Left, source.Value.Y - Area.Top);
|
||||
EndPoint = new PointBase(target.Value.X - Area.Left, target.Value.Y - Area.Top);
|
||||
StartAngle = PathGeneratorResult.SourceMarkerAngle;
|
||||
EndAngle = PathGeneratorResult.TargetMarkerAngle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user