From cf48e8ec85f8bb7c39082ca6e24537d936a4a337 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 27 Jul 2018 18:36:57 +0300 Subject: [PATCH] Fixed a bug that occured when begining to drag a reroute would move the reroute point -8 -8 no matter what --- Scripts/Editor/NodeEditorAction.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 12a48ec..9f6dd20 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using UnityEditor; @@ -112,11 +112,9 @@ namespace XNodeEditor { // Move selected reroutes with offset for (int i = 0; i < selectedReroutes.Count; i++) { Vector2 pos = mousePos + dragOffset[Selection.objects.Length + i]; - pos.x -= 8; - pos.y -= 8; if (gridSnap) { - pos.x = (Mathf.Round((pos.x + 8) / 16) * 16); - pos.y = (Mathf.Round((pos.y + 8) / 16) * 16); + pos.x = (Mathf.Round((pos.x + 8) / 16) * 16) - 8; + pos.y = (Mathf.Round((pos.y + 8) / 16) * 16) - 8; } selectedReroutes[i].SetPoint(pos); }