支持多个node保存到工具栏,显示还有点问题。

This commit is contained in:
kwai
2023-02-03 18:23:53 +08:00
parent 397ebcfac2
commit 2fde666182
12 changed files with 273 additions and 140 deletions

View File

@@ -512,6 +512,44 @@ namespace AIStudio.Wpf.DiagramDesigner
this.RaisePropertyChanged(nameof(Angle), GetOldValue<double>(nameof(Angle)), Angle);
}
public FullyCreatedConnectorInfo GetFullConnectorInfo(Guid connectorId, ConnectorOrientation connectorOrientation, double xRatio, double yRatio, bool isInnerPoint, bool isPortless)
{
if (isInnerPoint)
{
return this.Connectors.Where(p => p.XRatio == xRatio && p.YRatio == yRatio).FirstOrDefault();
}
else if (isPortless)
{
return this.PortlessConnector;
}
else
{
switch (connectorOrientation)
{
case ConnectorOrientation.Left:
return this.LeftConnector;
case ConnectorOrientation.TopLeft:
return this.TopLeftConnector;
case ConnectorOrientation.Top:
return this.TopConnector;
case ConnectorOrientation.TopRight:
return this.TopRightConnector;
case ConnectorOrientation.Right:
return this.RightConnector;
case ConnectorOrientation.BottomRight:
return this.BottomRightConnector;
case ConnectorOrientation.Bottom:
return this.BottomConnector;
case ConnectorOrientation.BottomLeft:
return this.BottomLeftConnector;
default:
throw new InvalidOperationException(
string.Format("Found invalid persisted Connector Orientation for Connector Id: {0}", connectorId));
}
}
}
public RectangleBase GetBounds(bool includePorts = false)
{
if (!includePorts)