mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
Merge 13988a736869dcc0889c52e4939c2fd32ee88622 into d6effd70f5574369e3415c423ef3e621ea309564
This commit is contained in:
commit
1911cd4850
@ -33,6 +33,7 @@ namespace XNodeEditor {
|
||||
DrawNodes();
|
||||
DrawSelectionBox();
|
||||
DrawTooltip();
|
||||
DrawToolbar();
|
||||
graphEditor.OnGUI();
|
||||
|
||||
// Run and reset onLateGUI
|
||||
@ -88,6 +89,28 @@ namespace XNodeEditor {
|
||||
GUI.DrawTextureWithTexCoords(rect, gridTex, new Rect(tileOffset, tileAmount));
|
||||
GUI.DrawTextureWithTexCoords(rect, crossTex, new Rect(tileOffset + new Vector2(0.5f, 0.5f), tileAmount));
|
||||
}
|
||||
|
||||
private void DrawToolbar() {
|
||||
GUILayout.BeginHorizontal(EditorStyles.toolbar);
|
||||
{
|
||||
GUILayout.Space(2);
|
||||
GUILayout.Label(graph.name, EditorStyles.boldLabel);
|
||||
GUILayout.Space(10);
|
||||
|
||||
// Draw scale bar
|
||||
GUILayout.Label("Scale", EditorStyles.miniLabel);
|
||||
var newZoom = GUILayout.HorizontalSlider(
|
||||
zoom, 1f, 5f, GUILayout.MinWidth(40), GUILayout.MaxWidth(100)
|
||||
);
|
||||
GUILayout.Label(zoom.ToString("0.0#x"), EditorStyles.miniLabel, GUILayout.Width(30));
|
||||
if (Math.Abs(newZoom - zoom) > Mathf.Epsilon) {
|
||||
zoom = newZoom;
|
||||
}
|
||||
|
||||
GUILayout.FlexibleSpace();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
public void DrawSelectionBox() {
|
||||
if (currentActivity == NodeActivity.DragGrid) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user