mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-02 15:50:51 +08:00
xx
This commit is contained in:
@@ -3160,17 +3160,33 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
if (port.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())) //如果两个位置相交
|
||||
{
|
||||
|
||||
port.DataItem.ShowConnectors = true;
|
||||
if (port.CanAttachTo(blockDesignerItemViewModel) == true)
|
||||
var innerport = port.GetAllContain(port.Children, false).Where(p => p.GetBounds().IntersectsWith(blockDesignerItemViewModel.GetBounds())).OrderByDescending(p => p.ContainLevel).FirstOrDefault();
|
||||
if (innerport != null)
|
||||
{
|
||||
port.BeAttachTo = true;
|
||||
innerport.DataItem.ShowConnectors = true;
|
||||
if (innerport.CanAttachTo(blockDesignerItemViewModel) == true)
|
||||
{
|
||||
innerport.BeAttachTo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
innerport.DisableAttachTo = true;
|
||||
}
|
||||
return innerport;
|
||||
}
|
||||
else
|
||||
{
|
||||
port.DisableAttachTo = true;
|
||||
port.DataItem.ShowConnectors = true;
|
||||
if (port.CanAttachTo(blockDesignerItemViewModel) == true)
|
||||
{
|
||||
port.BeAttachTo = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
port.DisableAttachTo = true;
|
||||
}
|
||||
return port;
|
||||
}
|
||||
return port;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3190,7 +3206,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
public void ClearNearContain()
|
||||
{
|
||||
Items.OfType<BlockDesignerItemViewModel>().ToList().SelectMany(n => n.Contains).Where(p => p.BeAttachTo == true || p.DisableAttachTo == true).ToList()
|
||||
Items.OfType<BlockDesignerItemViewModel>().ToList().SelectMany(n => n.GetAllContain()).Where(p => p.BeAttachTo == true || p.DisableAttachTo == true).ToList()
|
||||
.ForEach(p => {
|
||||
p.DisableAttachTo = false;
|
||||
p.BeAttachTo = false;
|
||||
|
||||
Reference in New Issue
Block a user