mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
Merge upstream with fork.
This commit is contained in:
commit
1cbcccd5da
@ -136,12 +136,7 @@ namespace XNodeEditor {
|
|||||||
Repaint();
|
Repaint();
|
||||||
}
|
}
|
||||||
} else if (e.button == 1 || e.button == 2) {
|
} else if (e.button == 1 || e.button == 2) {
|
||||||
Vector2 tempOffset = panOffset;
|
panOffset += e.delta * zoom;
|
||||||
tempOffset += e.delta * zoom;
|
|
||||||
// Round value to increase crispyness of UI text
|
|
||||||
tempOffset.x = Mathf.Round(tempOffset.x);
|
|
||||||
tempOffset.y = Mathf.Round(tempOffset.y);
|
|
||||||
panOffset = tempOffset;
|
|
||||||
isPanning = true;
|
isPanning = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -276,6 +271,7 @@ namespace XNodeEditor {
|
|||||||
GenericMenu menu = new GenericMenu();
|
GenericMenu menu = new GenericMenu();
|
||||||
NodeEditor.GetEditor(hoveredNode).AddContextMenuItems(menu);
|
NodeEditor.GetEditor(hoveredNode).AddContextMenuItems(menu);
|
||||||
menu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero));
|
menu.DropDown(new Rect(Event.current.mousePosition, Vector2.zero));
|
||||||
|
e.Use(); // Fixes copy/paste context menu appearing in Unity 5.6.6f2 - doesn't occur in 2018.3.2f1 Probably needs to be used in other places.
|
||||||
} else if (!IsHoveringNode) {
|
} else if (!IsHoveringNode) {
|
||||||
GenericMenu menu = new GenericMenu();
|
GenericMenu menu = new GenericMenu();
|
||||||
graphEditor.AddContextMenuItems(menu);
|
graphEditor.AddContextMenuItems(menu);
|
||||||
|
|||||||
@ -123,8 +123,9 @@ namespace XNodeEditor {
|
|||||||
|
|
||||||
public Vector2 GridToWindowPositionNoClipped(Vector2 gridPosition) {
|
public Vector2 GridToWindowPositionNoClipped(Vector2 gridPosition) {
|
||||||
Vector2 center = position.size * 0.5f;
|
Vector2 center = position.size * 0.5f;
|
||||||
float xOffset = (center.x * zoom + (panOffset.x + gridPosition.x));
|
// UI Sharpness complete fix - Round final offset not panOffset
|
||||||
float yOffset = (center.y * zoom + (panOffset.y + gridPosition.y));
|
float xOffset = Mathf.Round(center.x * zoom + (panOffset.x + gridPosition.x));
|
||||||
|
float yOffset = Mathf.Round(center.y * zoom + (panOffset.y + gridPosition.y));
|
||||||
return new Vector2(xOffset, yOffset);
|
return new Vector2(xOffset, yOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user