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.
This commit is contained in:
Brandon Thetford
2024-02-21 02:44:20 -07:00
parent e9deb280c4
commit 8e0a193cab

View File

@@ -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