From 5aa5ea701efd7714a6428aac09a90602c625a03e Mon Sep 17 00:00:00 2001 From: jamieyello Date: Sat, 4 Apr 2020 03:39:42 -0400 Subject: [PATCH] Add RectangleF.TopRight (#661) There was a TopLeft and a BottomRight, but no TopRight or BottomLeft... But there could be. :) --- Source/MonoGame.Extended/Math/RectangleF.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/MonoGame.Extended/Math/RectangleF.cs b/Source/MonoGame.Extended/Math/RectangleF.cs index f5b219c8..89cb18e3 100644 --- a/Source/MonoGame.Extended/Math/RectangleF.cs +++ b/Source/MonoGame.Extended/Math/RectangleF.cs @@ -120,6 +120,16 @@ namespace MonoGame.Extended /// public Point2 TopLeft => new Point2(X, Y); + /// + /// Gets the representing the top-right of this . + /// + public Point2 TopRight => new Point2(X + Width, Y); + + /// + /// Gets the representing the bottom-left of this . + /// + public Point2 BottomLeft => new Point2(X, Y + Height); + /// /// Gets the representing the bottom-right of this . /// @@ -679,4 +689,4 @@ namespace MonoGame.Extended internal string DebugDisplayString => string.Concat(X, " ", Y, " ", Width, " ", Height); } -} \ No newline at end of file +}