From 8e0a193cabc663a4e4989719f71d0f8c615652ce Mon Sep 17 00:00:00 2001 From: Brandon Thetford Date: Wed, 21 Feb 2024 02:44:20 -0700 Subject: [PATCH] In-line this, which is only used once The zero checks are redundant. If the point is not inside the rectangle, it isn't inside the rectangle, period. --- Terminal.Gui/Application.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Terminal.Gui/Application.cs b/Terminal.Gui/Application.cs index 82180242c..5691f51e9 100644 --- a/Terminal.Gui/Application.cs +++ b/Terminal.Gui/Application.cs @@ -1460,7 +1460,7 @@ public static partial class Application View = view }; - if (OutsideRect (new Point (nme.X, nme.Y), MouseGrabView.Bounds)) + if (MouseGrabView.Bounds.Contains (nme.X, nme.Y) is false) { // The mouse has moved outside the bounds of the the view that // grabbed the mouse, so we tell the view that last got @@ -1623,8 +1623,6 @@ public static partial class Application return true; } - - static bool OutsideRect (Point p, Rectangle r) { return p.X < 0 || p.X > r.Right || p.Y < 0 || p.Y > r.Bottom; } } #nullable restore