1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-22 18:26:14 +08:00

Merge pull request #56 from ddalacu/master

Fixed reroute points moving -8 -8 when grid snap is off
This commit is contained in:
Thor Brigsted 2018-08-27 11:32:37 +02:00 committed by GitHub
commit 8f7e3299d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 / 16) * 16);
pos.y = (Mathf.Round(pos.y / 16) * 16);
}
selectedReroutes[i].SetPoint(pos);
}