mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-14 21:26:35 +08:00
这个线有点偏差
This commit is contained in:
@@ -127,7 +127,7 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
var size = MeasureOverride(mindNode);
|
||||
ArrangeOverride(mindNode);
|
||||
|
||||
mindNode.Root.BringToFrontCommand.Execute(new SelectableDesignerItemViewModelBase[] { mindNode });
|
||||
mindNode.Root.BringToFrontCommand.Execute(mindNode.Root.Items.OfType<DesignerItemViewModelBase>());
|
||||
|
||||
mindNode.GetLevel1Node().LayoutUpdating = false;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
var childrensizes = mindNode.Children.Select(p => MeasureOverride(p, mindNode.IsExpanded && isExpanded)).ToArray();
|
||||
var lastchildsize = childrensizes.LastOrDefault();
|
||||
sizewithSpacing = new SizeBase(sizewithSpacing.Width + childrensizes.Sum(p => p.Height) - lastchildsize.Height / 2 + lastchildsize.Width, sizewithSpacing.Height + childrensizes.Sum(p => p.Height));
|
||||
sizewithSpacing = new SizeBase(sizewithSpacing.Height + childrensizes.Sum(p => p.Height) - lastchildsize.Height / 2 + lastchildsize.Width, sizewithSpacing.Height + childrensizes.Sum(p => p.Height));
|
||||
}
|
||||
else if (mindNode.NodeLevel == NodeLevel.Level3 || mindNode.NodeLevel == NodeLevel.Level4)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
foreach (var child in bottoms)
|
||||
{
|
||||
child.Left = bottomleft + child.Spacing.Width + child.Offset.X;
|
||||
child.Top = bottomtop + child.ItemHeight + child.Spacing.Height + child.Offset.Y;
|
||||
child.Top = bottomtop + child.Spacing.Height + child.Offset.Y;
|
||||
child.DesiredPosition = child.Position;
|
||||
bottomleft += child.DesiredSize.Width;
|
||||
|
||||
@@ -217,11 +217,10 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
if (mindNode.ConnectorOrientation == ConnectorOrientation.BottomLeft)
|
||||
{
|
||||
double left = mindNode.Left - mindNode.Spacing.Width + mindNode.DesiredSize.Height;
|
||||
double left = mindNode.Left + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
double top = mindNode.Top - mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
|
||||
foreach (var child in mindNode.Children)
|
||||
{
|
||||
child.Left = left + child.DesiredSize.Height - child.ItemHeight / 2 - child.Spacing.Height + child.Offset.X;
|
||||
@@ -241,23 +240,22 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
}
|
||||
else
|
||||
{
|
||||
double left = mindNode.Left - mindNode.Spacing.Width + mindNode.DesiredSize.Height;
|
||||
double top = mindNode.Top - mindNode.Spacing.Height;
|
||||
double left = mindNode.Left + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
double top = mindNode.Top + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
|
||||
foreach (var child in mindNode.Children)
|
||||
{
|
||||
child.Left = left + child.DesiredSize.Height - child.ItemHeight / 2 - child.Spacing.Height + child.Offset.X;
|
||||
child.Top = top - child.DesiredSize.Height + child.ItemHeight / 2 + child.Spacing.Height + child.Offset.Y;
|
||||
child.Top = top + child.DesiredSize.Height - child.ItemHeight / 2 - child.Spacing.Height + child.Offset.Y;
|
||||
child.DesiredPosition = child.Position;
|
||||
top -= child.DesiredSize.Height;
|
||||
top += child.DesiredSize.Height;
|
||||
left += child.DesiredSize.Height;
|
||||
|
||||
ArrangeOverride(child);
|
||||
|
||||
var connect = mindNode.Root?.Items.OfType<ConnectionViewModel>().FirstOrDefault(p => p.SourceConnectorInfo?.DataItem == mindNode && p.SinkConnectorInfoFully?.DataItem == child);
|
||||
connect?.SetSourcePort(mindNode.BottomLeftConnector);
|
||||
connect?.SetSourcePort(mindNode.TopLeftConnector);
|
||||
connect?.SetSinkPort(child.LeftConnector);
|
||||
connect?.SetVisible(child.Visible);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user