1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

Zoom System Fixes

- Due to the OnGUI method being called last to draw over everything else in the window, the GUI.Group being created in the new zoom system was also moving around the GUI elements created in the NodeGraphEditor OnGUI method.
This commit is contained in:
Adsito 2019-06-14 14:55:28 +10:00
parent 53bba68ae0
commit d6ae3bedce

View File

@ -30,7 +30,7 @@ namespace XNodeEditor {
DrawNodes();
DrawSelectionBox();
DrawTooltip();
graphEditor.OnGUI();
DrawOnGUI();
// Run and reset onLateGUI
if (onLateGUI != null) {
@ -443,5 +443,15 @@ namespace XNodeEditor {
Repaint();
}
}
private void DrawOnGUI() // Ends the GUI Group temporarily to draw any additional elements in the NodeGraphEditor.
{
GUI.EndGroup();
Rect rect = new Rect(new Vector2(-1f, 20f), new Vector2(Screen.width, Screen.height));
GUI.BeginGroup(rect);
graphEditor.OnGUI();
GUI.EndGroup();
GUI.BeginGroup(new Rect(0.0f, topPadding - (topPadding * zoom), Screen.width, Screen.height));
}
}
}