mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +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:
parent
f65d4a2dd7
commit
cf48e8ec85
@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
@ -112,11 +112,9 @@ namespace XNodeEditor {
|
|||||||
// Move selected reroutes with offset
|
// Move selected reroutes with offset
|
||||||
for (int i = 0; i < selectedReroutes.Count; i++) {
|
for (int i = 0; i < selectedReroutes.Count; i++) {
|
||||||
Vector2 pos = mousePos + dragOffset[Selection.objects.Length + i];
|
Vector2 pos = mousePos + dragOffset[Selection.objects.Length + i];
|
||||||
pos.x -= 8;
|
|
||||||
pos.y -= 8;
|
|
||||||
if (gridSnap) {
|
if (gridSnap) {
|
||||||
pos.x = (Mathf.Round((pos.x + 8) / 16) * 16);
|
pos.x = (Mathf.Round((pos.x + 8) / 16) * 16) - 8;
|
||||||
pos.y = (Mathf.Round((pos.y + 8) / 16) * 16);
|
pos.y = (Mathf.Round((pos.y + 8) / 16) * 16) - 8;
|
||||||
}
|
}
|
||||||
selectedReroutes[i].SetPoint(pos);
|
selectedReroutes[i].SetPoint(pos);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user