1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00

Fixed a bug that occured when begining to drag a reroute would move the reroute point -8 -8 no matter what

This commit is contained in:
Paul 2018-07-27 18:36:57 +03:00
parent f65d4a2dd7
commit cf48e8ec85

View File

@ -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);
}