diff --git a/.gitignore b/.gitignore index 64ab4c07..c75a01ee 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ sysinfo.txt .git.meta .gitignore.meta .gitattributes.meta + +# OS X only: +.DS_Store \ No newline at end of file diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 1a025560..b1127329 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -32,6 +32,7 @@ public enum NodeActivity { Idle, HoldNode, DragNode, HoldGrid, DragGrid } private Rect selectionBox; private bool isDoubleClick = false; private Vector2 lastMousePosition; + private float dragThreshold = 1f; public void Controls() { wantsMouseMove = true; @@ -134,8 +135,11 @@ public void Controls() { Repaint(); } } else if (e.button == 1 || e.button == 2) { - panOffset += e.delta * zoom; - isPanning = true; + //check drag threshold for larger screens + if (e.delta.magnitude > dragThreshold) { + panOffset += e.delta * zoom; + isPanning = true; + } } break; case EventType.MouseDown: diff --git a/Scripts/Editor/NodeEditorWindow.cs b/Scripts/Editor/NodeEditorWindow.cs index a7517226..4f0a102c 100644 --- a/Scripts/Editor/NodeEditorWindow.cs +++ b/Scripts/Editor/NodeEditorWindow.cs @@ -81,6 +81,8 @@ void OnFocus() { graphEditor.OnWindowFocus(); if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); } + + dragThreshold = Math.Max(1f, Screen.width / 1000f); } void OnLostFocus() {