1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

Altered drag and right click controls

This commit is contained in:
Oli 2023-01-09 21:44:02 +00:00
parent a44b58b19a
commit 883e585b65

View File

@ -146,13 +146,10 @@ namespace XNodeEditor {
selectionBox = new Rect(boxStartPos, boxSize); selectionBox = new Rect(boxStartPos, boxSize);
Repaint(); Repaint();
} }
} else if (e.button == 1 || e.button == 2) { } else if (e.button == 2) {
//check drag threshold for larger screens
if (e.delta.magnitude > dragThreshold) {
panOffset += e.delta * zoom; panOffset += e.delta * zoom;
isPanning = true; isPanning = true;
} }
}
break; break;
case EventType.MouseDown: case EventType.MouseDown:
Repaint(); Repaint();
@ -277,7 +274,7 @@ namespace XNodeEditor {
Repaint(); Repaint();
currentActivity = NodeActivity.Idle; currentActivity = NodeActivity.Idle;
} else if (e.button == 1 || e.button == 2) { } else if (e.button == 1) {
if (!isPanning) { if (!isPanning) {
if (IsDraggingPort) { if (IsDraggingPort) {
draggedOutputReroutes.Add(WindowToGridPosition(e.mousePosition)); draggedOutputReroutes.Add(WindowToGridPosition(e.mousePosition));