|
|
@ -35,10 +35,8 @@ namespace Fungus.EditorUtils |
|
|
|
protected Texture2D addTexture; |
|
|
|
protected Texture2D addTexture; |
|
|
|
|
|
|
|
|
|
|
|
protected Rect selectionBox; |
|
|
|
protected Rect selectionBox; |
|
|
|
protected Vector2 startSelectionBoxPosition; |
|
|
|
protected Vector2 startSelectionBoxPosition = new Vector2(-1.0f, -1.0f); |
|
|
|
protected List<Block> mouseDownSelectionState; |
|
|
|
protected List<Block> mouseDownSelectionState = new List<Block>(); |
|
|
|
|
|
|
|
|
|
|
|
protected bool cursorZoom = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MenuItem("Tools/Fungus/Flowchart Window")] |
|
|
|
[MenuItem("Tools/Fungus/Flowchart Window")] |
|
|
|
static void Init() |
|
|
|
static void Init() |
|
|
@ -178,11 +176,6 @@ namespace Fungus.EditorUtils |
|
|
|
var newZoom = GUILayout.HorizontalSlider(flowchart.Zoom, minZoomValue, maxZoomValue, GUILayout.Width(100)); |
|
|
|
var newZoom = GUILayout.HorizontalSlider(flowchart.Zoom, minZoomValue, maxZoomValue, GUILayout.Width(100)); |
|
|
|
DoZoom(flowchart, newZoom - flowchart.Zoom, Vector2.one * 0.5f); |
|
|
|
DoZoom(flowchart, newZoom - flowchart.Zoom, Vector2.one * 0.5f); |
|
|
|
|
|
|
|
|
|
|
|
GUILayout.Space(8); |
|
|
|
|
|
|
|
var toggleStyle = new GUIStyle(GUI.skin.button); |
|
|
|
|
|
|
|
toggleStyle.fontSize = 8; |
|
|
|
|
|
|
|
cursorZoom = GUILayout.Toggle(cursorZoom, " Cursor\nZoom", toggleStyle, GUILayout.Width(45), GUILayout.Height(22)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GUILayout.FlexibleSpace(); |
|
|
|
GUILayout.FlexibleSpace(); |
|
|
|
|
|
|
|
|
|
|
|
GUILayout.BeginVertical(); |
|
|
|
GUILayout.BeginVertical(); |
|
|
@ -590,16 +583,9 @@ namespace Fungus.EditorUtils |
|
|
|
if (zoom && selectionBox.size == Vector2.zero) |
|
|
|
if (zoom && selectionBox.size == Vector2.zero) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Vector2 zoomCenter; |
|
|
|
Vector2 zoomCenter; |
|
|
|
if (cursorZoom) |
|
|
|
zoomCenter.x = Event.current.mousePosition.x / position.width; |
|
|
|
{ |
|
|
|
zoomCenter.y = Event.current.mousePosition.y / position.height; |
|
|
|
zoomCenter.x = Event.current.mousePosition.x / position.width; |
|
|
|
zoomCenter *= flowchart.Zoom; |
|
|
|
zoomCenter.y = Event.current.mousePosition.y / position.height; |
|
|
|
|
|
|
|
zoomCenter *= flowchart.Zoom; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
zoomCenter = Vector2.one * 0.5f; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DoZoom(flowchart, -Event.current.delta.y * 0.01f, zoomCenter); |
|
|
|
DoZoom(flowchart, -Event.current.delta.y * 0.01f, zoomCenter); |
|
|
|
} |
|
|
|
} |
|
|
|