This commit is contained in:
艾竹
2023-06-18 18:43:48 +08:00
parent af1cacc846
commit b946c2df93
4 changed files with 31 additions and 11 deletions

View File

@@ -3221,7 +3221,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{
if (port.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())) //如果两个位置相交
{
var innerport = port.GetAllContain(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
var innerport = port.GetAllContainers(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
if (innerport != null)
{
innerport.DataItem.ShowConnectors = true;
@@ -3356,7 +3356,7 @@ namespace AIStudio.Wpf.DiagramDesigner
{
if (port.GetBounds().IntersectsWith(blockDesignerItemTempLink.GetBounds())) //如果两个位置相交
{
var innerport = port.GetAllContain(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemTempLink.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
var innerport = port.GetAllContainers(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemTempLink.GetBounds())).OrderByDescending(p => p.ContainerLevel).FirstOrDefault();
if (innerport != null)
{
innerport.DataItem.ShowConnectors = true;
@@ -3403,7 +3403,7 @@ namespace AIStudio.Wpf.DiagramDesigner
public void ClearNearContain()
{
Items.OfType<BlockDesignerItemViewModel>().ToList().SelectMany(n => n.GetAllContain()).Where(p => p.BeAttachTo == true || p.DisableAttachTo == true).ToList()
Items.OfType<BlockDesignerItemViewModel>().ToList().SelectMany(n => n.GetAllContainers()).Where(p => p.BeAttachTo == true || p.DisableAttachTo == true).ToList()
.ForEach(p => {
p.DisableAttachTo = false;
p.BeAttachTo = false;