From 1e44fcb3eb101cd4b7eb258e4bd397cbf551c131 Mon Sep 17 00:00:00 2001 From: Kailey Joanette Date: Wed, 29 Apr 2020 12:40:14 -0400 Subject: [PATCH] Move ensured node indices up to prevent SelectNode index errors --- Scripts/Editor/NodeEditorGUI.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index 7f36e3f..d9df9c9 100755 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -22,8 +22,6 @@ namespace XNodeEditor { Event e = Event.current; Matrix4x4 m = GUI.matrix; if (graph == null) return; - ValidateGraphEditor(); - Controls(); // Ensure we have all node indices covered while (orderedNodeIndices.Count < graph.nodes.Count) @@ -33,6 +31,9 @@ namespace XNodeEditor { orderedNodeIndices.RemoveAt( removeIndex ); } + ValidateGraphEditor(); + Controls(); + DrawGrid(position, zoom, panOffset); DrawConnections(); DrawDraggedConnection();