1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00

Fixed bug where a null node would stop node drawing

This commit is contained in:
Thor Brigsted 2017-10-29 21:11:39 +01:00
parent b48f7d63b4
commit 29b9841014

View File

@ -150,14 +150,16 @@ public partial class NodeEditorWindow {
Vector2 mousePos = Event.current.mousePosition; Vector2 mousePos = Event.current.mousePosition;
if (e.type != EventType.Layout) { if (e.type != EventType.Layout) {
hoveredNode = null; hoveredNode = null;
hoveredPort = null; hoveredPort = null;
} }
foreach (Node node in graph.nodes) { for (int n = 0; n < graph.nodes.Count; n++) {
if (node == null) return; while (graph.nodes[n] == null) graph.nodes.RemoveAt(n);
if (n >= graph.nodes.Count) return;
Node node = graph.nodes[n];
NodeEditor nodeEditor = GetNodeEditor(node.GetType()); NodeEditor nodeEditor = GetNodeEditor(node.GetType());
nodeEditor.target = node; nodeEditor.target = node;
@ -213,6 +215,7 @@ public partial class NodeEditorWindow {
GUILayout.EndArea(); GUILayout.EndArea();
} }
EndZoomed(position, zoom); EndZoomed(position, zoom);
//If a change in hash is detected in the selected node, call OnValidate method. //If a change in hash is detected in the selected node, call OnValidate method.