From ebe059fff38d723af668855a5ab5a95f1f20a083 Mon Sep 17 00:00:00 2001 From: Brice Date: Mon, 19 Oct 2020 14:09:49 +0200 Subject: [PATCH] fix edge case with 2 points outside the screen on either side of it, where the edge should show up --- Scripts/Editor/NodeEditorGUI.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Scripts/Editor/NodeEditorGUI.cs b/Scripts/Editor/NodeEditorGUI.cs index fe9279d..3e0c8d7 100755 --- a/Scripts/Editor/NodeEditorGUI.cs +++ b/Scripts/Editor/NodeEditorGUI.cs @@ -153,8 +153,9 @@ namespace XNodeEditor { var p1 = gridPoints[1]; var windowRect = new Rect(Vector2.zero, new Vector2(position.width, position.height)); + var noddleRect = new Rect(p0.x, p0.y, Mathf.Abs(p0.x - p1.x), Mathf.Abs(p0.y - p1.y)); - if (!windowRect.Contains(p0) && !windowRect.Contains(p1)) return; + if (!windowRect.Overlaps(noddleRect)) return; } Color originalHandlesColor = Handles.color;