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,21 +46,28 @@ namespace XNodeEditor.NodeGroups {
|
|||||||
selection.AddRange(group.GetNodes());
|
selection.AddRange(group.GetNodes());
|
||||||
// Select Reroutes
|
// Select Reroutes
|
||||||
foreach (Node node in target.graph.nodes) {
|
foreach (Node node in target.graph.nodes) {
|
||||||
foreach (NodePort port in node.Ports) {
|
if (node != null)
|
||||||
for (int i = 0; i < port.ConnectionCount; i++) {
|
{
|
||||||
List<Vector2> reroutes = port.GetReroutePoints(i);
|
foreach (NodePort port in node.Ports) {
|
||||||
for (int k = 0; k < reroutes.Count; k++) {
|
for (int i = 0; i < port.ConnectionCount; i++) {
|
||||||
Vector2 p = reroutes[k];
|
List<Vector2> reroutes = port.GetReroutePoints(i);
|
||||||
if (p.x < group.position.x) continue;
|
for (int k = 0; k < reroutes.Count; k++) {
|
||||||
if (p.y < group.position.y) continue;
|
Vector2 p = reroutes[k];
|
||||||
if (p.x > group.position.x + group.width) continue;
|
if (p.x < group.position.x) continue;
|
||||||
if (p.y > group.position.y + group.height + 30) continue;
|
if (p.y < group.position.y) continue;
|
||||||
if (NodeEditorWindow.current.selectedReroutes.Any(x => x.port == port && x.connectionIndex == i && x.pointIndex == k)) continue;
|
if (p.x > group.position.x + group.width) continue;
|
||||||
NodeEditorWindow.current.selectedReroutes.Add(
|
if (p.y > group.position.y + group.height + 30) continue;
|
||||||
new Internal.RerouteReference(port, i, k)
|
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();
|
Selection.objects = selection.Distinct().ToArray();
|
||||||
@ -101,4 +108,4 @@ namespace XNodeEditor.NodeGroups {
|
|||||||
EditorGUIUtility.AddCursorRect(rect, MouseCursor.ResizeUpLeft);
|
EditorGUIUtility.AddCursorRect(rect, MouseCursor.ResizeUpLeft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user