convenience method to create a Rectangle from Left/Top/Right/Bottom coordinates

This commit is contained in:
Michael Becker 2021-10-27 07:42:10 -04:00
parent fd1c4bece4
commit 545b3728f1
No known key found for this signature in database
GPG Key ID: 98C333A81F18C22C

View File

@ -78,6 +78,24 @@ namespace MBS.Framework.Drawing
return rect;
}
/// <summary>
/// Creates a <see cref="Rectangle" /> from left, top, right, bottom coordinates.
/// </summary>
/// <returns>The ltrb.</returns>
/// <param name="left">Bounding box l.</param>
/// <param name="top">Bounding box t.</param>
/// <param name="right">Bounding box r.</param>
/// <param name="bottom">Bounding box b.</param>
public static Rectangle FromLTRB(double left, double top, double right, double bottom)
{
Rectangle rect = new Rectangle();
rect.X = left;
rect.Y = top;
rect.Right = right;
rect.Bottom = bottom;
return rect;
}
/// <summary>
/// Normalize this instance.
/// </summary>