mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
xx
This commit is contained in:
@@ -1499,7 +1499,7 @@
|
||||
<Path Width="10" Height="10" Stretch="Uniform" Fill="Black" Data="M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"></Path>
|
||||
</Button>
|
||||
<Line X1="0" Y1="0" X2="150" Y2="0" Stroke="Gray" StrokeThickness="0.5" VerticalAlignment="Bottom" Grid.ColumnSpan="3"></Line>
|
||||
<TextBlock Grid.Row="1" Grid.ColumnSpan="3" Text="{Binding PageViewModel.DiagramViewModel.SearchInfo}"/>
|
||||
<TextBlock Grid.Row="1" Grid.ColumnSpan="3" Margin="2,0,0,0" VerticalAlignment="Center" Text="{Binding PageViewModel.DiagramViewModel.SearchInfo}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Fluent:RibbonGroupBox>
|
||||
|
||||
@@ -592,7 +592,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
get
|
||||
{
|
||||
return _searchText;
|
||||
return _searchInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -2645,7 +2645,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private void ExecutedSearchDownCommand(object obj)
|
||||
{
|
||||
if (obj != null)
|
||||
if (!string.IsNullOrEmpty(obj?.ToString()))
|
||||
{
|
||||
var selecteddesign = SelectedItem as DesignerItemViewModelBase;
|
||||
var searchitems = Items.OfType<DesignerItemViewModelBase>().Where(p => p.Text?.Contains(obj.ToString()) == true).ToList();
|
||||
|
||||
@@ -679,7 +679,7 @@
|
||||
<Path Width="10" Height="10" Stretch="Uniform" Fill="Black" Data="M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"></Path>
|
||||
</Button>
|
||||
<Line X1="0" Y1="0" X2="150" Y2="0" Stroke="Gray" StrokeThickness="0.5" VerticalAlignment="Bottom" Grid.ColumnSpan="3"></Line>
|
||||
<TextBlock Grid.Row="1" Grid.ColumnSpan="3" Text="{Binding SearchInfo}"/>
|
||||
<TextBlock Grid.Row="1" Grid.ColumnSpan="3" Margin="2,0,0,0" VerticalAlignment="Center" Text="{Binding SearchInfo}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
@@ -138,8 +138,10 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
if (mindNode.NodeLevel == 0)
|
||||
{
|
||||
double left = mindNode.MiddlePosition.X - Math.Max(mindNode.DesiredSize.Width, mindNode.Children.SumOrDefault(p => p.DesiredSize.Width)) / 2;
|
||||
double top = mindNode.MiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height;
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth / 2 - Math.Max(mindNode.DesiredSize.Width, mindNode.Children.SumOrDefault(p => p.DesiredSize.Width)) / 2;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
@@ -159,14 +161,13 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
connector?.SetVisible(child.Visible);
|
||||
}
|
||||
}
|
||||
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
|
||||
mindNode.Offset = new PointBase();//修正后归0
|
||||
}
|
||||
else
|
||||
{
|
||||
double left = mindNode.DesiredMiddlePosition.X;
|
||||
double top = mindNode.DesiredMiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth / 2;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
|
||||
@@ -176,9 +176,11 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
if (mindNode.NodeLevel == 0)
|
||||
{
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
|
||||
var tops = mindNode.Children.Where(p => p.ConnectorOrientation == ConnectorOrientation.BottomLeft).ToList();
|
||||
double topleft = mindNode.MiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width;
|
||||
double toptop = mindNode.MiddlePosition.Y - mindNode.ItemHeight / 2 - mindNode.Spacing.Height;
|
||||
double topleft = mindNode.DesiredPosition.X + mindNode.ItemWidth + mindNode.Spacing.Width;
|
||||
double toptop = mindNode.DesiredPosition.Y - mindNode.Spacing.Height;
|
||||
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
@@ -201,8 +203,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
|
||||
var bottomoffset = mindNode.Spacing.Width / 2;
|
||||
var bottoms = mindNode.Children.Where(p => p.ConnectorOrientation == ConnectorOrientation.TopLeft).ToList();
|
||||
double bottomleft = mindNode.MiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width + bottomoffset;
|
||||
double bottomtop = mindNode.MiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height;
|
||||
double bottomleft = mindNode.DesiredPosition.X + mindNode.ItemWidth + mindNode.Spacing.Width + bottomoffset;
|
||||
double bottomtop = mindNode.DesiredPosition.Y + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
@@ -222,8 +224,7 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
connector?.SetVisible(child.Visible);
|
||||
}
|
||||
}
|
||||
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
|
||||
mindNode.Offset = new PointBase();//修正后归0
|
||||
}
|
||||
else if (mindNode.NodeLevel == 1)
|
||||
@@ -281,8 +282,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
if (mindNode.GetLevel1Node().ConnectorOrientation == ConnectorOrientation.BottomLeft)
|
||||
{
|
||||
double left = mindNode.DesiredMiddlePosition.X;
|
||||
double top = mindNode.DesiredMiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth / 2;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
@@ -304,8 +305,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
}
|
||||
else
|
||||
{
|
||||
double left = mindNode.DesiredMiddlePosition.X;
|
||||
double bottom = mindNode.DesiredMiddlePosition.Y - mindNode.ItemHeight / 2 - mindNode.Spacing.Height;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth / 2;
|
||||
double bottom = mindNode.DesiredPosition.Y - mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
|
||||
@@ -131,8 +131,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
}
|
||||
|
||||
double left = mindNode.DesiredMiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width;
|
||||
double top = mindNode.DesiredMiddlePosition.Y - Math.Min(mindNode.DesiredSize.Height, mindNode.Children.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth + mindNode.Spacing.Width;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight / 2 - Math.Min(mindNode.DesiredSize.Height, mindNode.Children.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
|
||||
@@ -143,11 +143,13 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
if (mindNode.NodeLevel == 0)
|
||||
{
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
var rights = mindNode.Children.Where(p => p.ConnectorOrientation == ConnectorOrientation.Left).ToList();
|
||||
double left = mindNode.MiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width;
|
||||
double lefttop = mindNode.MiddlePosition.Y - Math.Min(mindNode.DesiredSize.Height, rights.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth + mindNode.Spacing.Width;
|
||||
double lefttop = mindNode.DesiredPosition.Y + mindNode.ItemHeight / 2 - Math.Min(mindNode.DesiredSize.Height, rights.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
foreach (var child in rights)
|
||||
{
|
||||
child.Offset = new PointBase(child.Offset.X - child.RootNode.Offset.X, child.Offset.Y - child.RootNode.Offset.Y);
|
||||
@@ -166,8 +168,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
}
|
||||
|
||||
var lefts = mindNode.Children.Where(p => p.ConnectorOrientation == ConnectorOrientation.Right).ToList();
|
||||
double right = mindNode.MiddlePosition.X - mindNode.ItemWidth / 2 - mindNode.Spacing.Width;
|
||||
double righttop = mindNode.MiddlePosition.Y - Math.Min(mindNode.DesiredSize.Height, lefts.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
double right = mindNode.DesiredPosition.X - mindNode.Spacing.Width;
|
||||
double righttop = mindNode.DesiredPosition.Y + mindNode.ItemHeight / 2 - Math.Min(mindNode.DesiredSize.Height, lefts.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
foreach (var child in lefts)
|
||||
{
|
||||
child.Offset = new PointBase(child.Offset.X - child.RootNode.Offset.X, child.Offset.Y - child.RootNode.Offset.Y);
|
||||
@@ -184,16 +186,15 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
connector?.SetVisible(child.Visible);
|
||||
}
|
||||
}
|
||||
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
|
||||
mindNode.Offset = new PointBase();//修正后归0
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mindNode.GetLevel1Node().ConnectorOrientation == ConnectorOrientation.Left)
|
||||
{
|
||||
double left = mindNode.DesiredMiddlePosition.X + mindNode.ItemWidth / 2 + mindNode.Spacing.Width;
|
||||
double top = mindNode.DesiredMiddlePosition.Y - Math.Min(mindNode.DesiredSize.Height, mindNode.Children.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth + mindNode.Spacing.Width;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight / 2 - Math.Min(mindNode.DesiredSize.Height, mindNode.Children.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
@@ -215,8 +216,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
}
|
||||
else
|
||||
{
|
||||
double right = mindNode.DesiredMiddlePosition.X - mindNode.ItemWidth / 2 - mindNode.Spacing.Width;
|
||||
double top = mindNode.DesiredMiddlePosition.Y - Math.Min(mindNode.DesiredSize.Height, mindNode.Children.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
double right = mindNode.DesiredPosition.X - mindNode.Spacing.Width;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight / 2 - Math.Min(mindNode.DesiredSize.Height, mindNode.Children.SumOrDefault(p => p.DesiredSize.Height)) / 2;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
|
||||
@@ -133,8 +133,8 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
mindNode.DesiredPosition = mindNode.Position;
|
||||
}
|
||||
|
||||
double left = mindNode.DesiredMiddlePosition.X - Math.Max(mindNode.DesiredSize.Width, mindNode.Children.SumOrDefault(p => p.DesiredSize.Width)) / 2;
|
||||
double top = mindNode.DesiredMiddlePosition.Y + mindNode.ItemHeight / 2 + mindNode.Spacing.Height;
|
||||
double left = mindNode.DesiredPosition.X + mindNode.ItemWidth / 2 - Math.Max(mindNode.DesiredSize.Width, mindNode.Children.SumOrDefault(p => p.DesiredSize.Width)) / 2;
|
||||
double top = mindNode.DesiredPosition.Y + mindNode.ItemHeight + mindNode.Spacing.Height;
|
||||
if (mindNode.Children?.Count > 0)
|
||||
{
|
||||
foreach (var child in mindNode.Children)
|
||||
|
||||
Reference in New Issue
Block a user