Browse Source

Double Click block centres in Flowchart Window

master
Steve Halliwell 5 years ago
parent
commit
9d1060a58f
  1. 17
      Assets/Fungus/Scripts/Editor/FlowchartWindow.cs

17
Assets/Fungus/Scripts/Editor/FlowchartWindow.cs

@ -224,6 +224,8 @@ namespace Fungus.EditorUtils
} }
} }
private GUIStyle toolbarSeachCancelButtonStyle; private GUIStyle toolbarSeachCancelButtonStyle;
private bool didDoubleClick;
protected GUIStyle ToolbarSeachCancelButtonStyle protected GUIStyle ToolbarSeachCancelButtonStyle
{ {
get get
@ -1027,6 +1029,15 @@ namespace Fungus.EditorUtils
{ {
if (hitBlock != null) if (hitBlock != null)
{ {
if(e.clickCount == 2)
{
CenterBlock(hitBlock);
e.Use();
didDoubleClick = true;
return;
}
startDragPosition = e.mousePosition / flowchart.Zoom - flowchart.ScrollPos; startDragPosition = e.mousePosition / flowchart.Zoom - flowchart.ScrollPos;
Undo.RecordObject(flowchart, "Select"); Undo.RecordObject(flowchart, "Select");
@ -1177,6 +1188,12 @@ namespace Fungus.EditorUtils
switch (e.button) switch (e.button)
{ {
case MouseButton.Left: case MouseButton.Left:
if(didDoubleClick)
{
didDoubleClick = false;
return;
}
if (dragBlock != null) if (dragBlock != null)
{ {

Loading…
Cancel
Save