mirror of
https://github.com/Siccity/xNodeGroups.git
synced 2025-12-20 01:06:02 +08:00
Merge pull request #7 from RomanZanevski/patch-2
Connection point fix addition
This commit is contained in:
commit
b76baaddaf
@ -46,22 +46,29 @@ namespace XNodeEditor.NodeGroups {
|
||||
selection.AddRange(group.GetNodes());
|
||||
// Select Reroutes
|
||||
foreach (Node node in target.graph.nodes) {
|
||||
foreach (NodePort port in node.Ports) {
|
||||
for (int i = 0; i < port.ConnectionCount; i++) {
|
||||
List<Vector2> reroutes = port.GetReroutePoints(i);
|
||||
for (int k = 0; k < reroutes.Count; k++) {
|
||||
Vector2 p = reroutes[k];
|
||||
if (p.x < group.position.x) continue;
|
||||
if (p.y < group.position.y) continue;
|
||||
if (p.x > group.position.x + group.width) continue;
|
||||
if (p.y > group.position.y + group.height + 30) continue;
|
||||
if (NodeEditorWindow.current.selectedReroutes.Any(x => x.port == port && x.connectionIndex == i && x.pointIndex == k)) continue;
|
||||
NodeEditorWindow.current.selectedReroutes.Add(
|
||||
new Internal.RerouteReference(port, i, k)
|
||||
);
|
||||
if (node != null)
|
||||
{
|
||||
foreach (NodePort port in node.Ports) {
|
||||
for (int i = 0; i < port.ConnectionCount; i++) {
|
||||
List<Vector2> reroutes = port.GetReroutePoints(i);
|
||||
for (int k = 0; k < reroutes.Count; k++) {
|
||||
Vector2 p = reroutes[k];
|
||||
if (p.x < group.position.x) continue;
|
||||
if (p.y < group.position.y) continue;
|
||||
if (p.x > group.position.x + group.width) continue;
|
||||
if (p.y > group.position.y + group.height + 30) continue;
|
||||
if (NodeEditorWindow.current.selectedReroutes.Any(x => x.port == port && x.connectionIndex == i && x.pointIndex == k)) continue;
|
||||
NodeEditorWindow.current.selectedReroutes.Add(
|
||||
new Internal.RerouteReference(port, i, k)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Selection.objects = selection.Distinct().ToArray();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user