From 2651bfbeb5350e7a1a5a57248df45b613094fee3 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Sun, 21 Jan 2018 23:55:55 +0100 Subject: [PATCH] Increase crispyness of UI text --- Scripts/Editor/NodeEditorAction.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditorAction.cs b/Scripts/Editor/NodeEditorAction.cs index 3a70848..409eea8 100644 --- a/Scripts/Editor/NodeEditorAction.cs +++ b/Scripts/Editor/NodeEditorAction.cs @@ -54,7 +54,12 @@ namespace XNodeEditor { Repaint(); } } else if (e.button == 1 || e.button == 2) { - panOffset += e.delta * zoom; + Vector2 tempOffset = panOffset; + 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; } break;