diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 8021a16..e3cf227 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -32,6 +32,7 @@ namespace XNodeEditor { private Rect selectionBox; private bool isDoubleClick = false; private Vector2 lastMousePosition; + private float dragThreshold = 1f; public void Controls() { wantsMouseMove = true; @@ -134,8 +135,11 @@ namespace XNodeEditor { 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 1f64653..ec68331 100644 --- a/Scripts/Editor/NodeEditorWindow.cs +++ b/Scripts/Editor/NodeEditorWindow.cs @@ -78,6 +78,8 @@ namespace XNodeEditor { current = this; ValidateGraphEditor(); if (graphEditor != null && NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets(); + + dragThreshold = Screen.width / 1000f; } [InitializeOnLoadMethod]