convenience method to create a Rectangle from Left/Top/Right/Bottom coordinates
This commit is contained in:
parent
fd1c4bece4
commit
545b3728f1
@ -78,6 +78,24 @@ namespace MBS.Framework.Drawing
|
|||||||
return rect;
|
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>
|
/// <summary>
|
||||||
/// Normalize this instance.
|
/// Normalize this instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user