From cc72e448954402ef80e76021e2449a1d480deec9 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Mon, 27 Aug 2018 11:29:34 +0200 Subject: [PATCH] Fixed reroute point snap centering --- Scripts/Editor/NodeEditorAction.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 9f6dd20..260705d 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -113,8 +113,8 @@ namespace XNodeEditor { for (int i = 0; i < selectedReroutes.Count; i++) { Vector2 pos = mousePos + dragOffset[Selection.objects.Length + i]; if (gridSnap) { - pos.x = (Mathf.Round((pos.x + 8) / 16) * 16) - 8; - pos.y = (Mathf.Round((pos.y + 8) / 16) * 16) - 8; + pos.x = (Mathf.Round(pos.x / 16) * 16); + pos.y = (Mathf.Round(pos.y / 16) * 16); } selectedReroutes[i].SetPoint(pos); }