Skip to content

[DYN-4473] Plugging a wire from an output port into an input port and moving a collapsed group doesn't update wire locations #12537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -627,16 +627,24 @@ internal IEnumerable<PortModel> GetGroupInPorts(IEnumerable<NodeModel> ownerNode
if (ownerNodes != null)
{
return ownerNodes.SelectMany(x => x.InPorts
.Where(p => !p.IsConnected || !p.Connectors.Any(c => ownerNodes.Contains(c.Start.Owner)))
) ;
.Where(p => !p.IsConnected ||
!p.Connectors.Any(c => ownerNodes.Contains(c.Start.Owner)) ||
// If the port is connected to any of the groups outports
// we need to return it as well
p.Connectors.Any(c => outPorts.Select(m => m.PortModel).Contains(c.Start)))
);
}

// If this group does contain any AnnotationModels
// we only want to get the ports where the owner does
// not belong to a group.
return Nodes.OfType<NodeModel>()
.SelectMany(x => x.InPorts
.Where(p => !p.IsConnected || !p.Connectors.Any(c => Nodes.Contains(c.Start.Owner)))
.Where(p => !p.IsConnected ||
!p.Connectors.Any(c => Nodes.Contains(c.Start.Owner)) ||
// If the port is connected to any of the groups outports
// we need to return it as well
p.Connectors.Any(c => outPorts.Select(m => m.PortModel).Contains(c.Start)))
);
}

Expand All @@ -649,7 +657,11 @@ internal IEnumerable<PortModel> GetGroupOutPorts(IEnumerable<NodeModel> ownerNod
{
return ownerNodes
.SelectMany(x => x.OutPorts
.Where(p => !p.IsConnected || !p.Connectors.Any(c => ownerNodes.Contains(c.End.Owner)))
.Where(p => !p.IsConnected ||
!p.Connectors.Any(c => ownerNodes.Contains(c.End.Owner)) ||
// If the port is connected to any of the groups inports
// we need to return it as well
p.Connectors.Any(c => inPorts.Select(m => m.PortModel).Contains(c.End)))
);
}

Expand All @@ -658,7 +670,11 @@ internal IEnumerable<PortModel> GetGroupOutPorts(IEnumerable<NodeModel> ownerNod
// not belong to a group.
return Nodes.OfType<NodeModel>()
.SelectMany(x => x.OutPorts
.Where(p => !p.IsConnected || !p.Connectors.Any(c => Nodes.Contains(c.End.Owner)))
.Where(p => !p.IsConnected ||
!p.Connectors.Any(c => Nodes.Contains(c.End.Owner)) ||
// If the port is connected to any of the groups inports
// we need to return it as well
p.Connectors.Any(c => inPorts.Select(m => m.PortModel).Contains(c.End)))
);
}

Expand Down