Summary
Defines a rectangle.
Syntax
public readonly struct Rect : ValueType, IEquatable<Rect>
Constructors
Name | Summary |
---|---|
Rect |
Initializes a new instance of the Rect structure.
|
Rect |
Initializes a new instance of the Rect structure.
|
Rect |
Initializes a new instance of the Rect structure.
|
Rect |
Initializes a new instance of the Rect structure.
|
Fields
Name | Constant Value | Summary |
---|---|---|
Empty |
An empty rectangle.
static
|
Properties
Name | Value | Summary |
---|---|---|
Bottom | double |
Gets the bottom position of the rectangle.
|
BottomLeft | Point |
Gets the bottom left point of the rectangle.
|
BottomRight | Point |
Gets the bottom right point of the rectangle.
|
Center | Point |
Gets the center point of the rectangle.
|
Height | double |
Gets the height.
|
IsEmpty | bool |
Gets a value that indicates whether the rectangle is empty.
|
Left | double |
Gets the left position.
|
Position | Point |
Gets the position of the rectangle.
|
Right | double |
Gets the right position of the rectangle.
|
Size | Size |
Gets the size of the rectangle.
|
Top | double |
Gets the top position.
|
TopLeft | Point |
Gets the top left point of the rectangle.
|
TopRight | Point |
Gets the top right point of the rectangle.
|
Width | double |
Gets the width.
|
X | double |
Gets the X position.
|
Y | double |
Gets the Y position.
|
Methods
Name | Value | Summary |
---|---|---|
CenterRect |
Rect |
Centers another rectangle in this rectangle.
|
Contains |
bool |
Determines whether a point in in the bounds of the rectangle.
|
Contains |
bool |
Determines whether the rectangle fully contains another rectangle.
|
Deflate |
Rect |
Deflates the rectangle.
|
Deflate |
Rect |
Deflates the rectangle by a
Thickness .
|
Equals |
bool |
Returns a boolean indicating whether the given object is equal to this rectangle.
|
Equals |
bool |
Returns a boolean indicating whether the rect is equal to the other given rect.
|
GetHashCode |
int |
Returns the hash code for this instance.
|
Inflate |
Rect |
Inflates the rectangle.
|
Inflate |
Rect |
Inflates the rectangle.
|
Intersect |
Rect |
Gets the intersection of two rectangles.
|
Intersects |
bool |
Determines whether a rectangle intersects with this rectangle.
|
Normalize |
Rect | |
Parse |
Rect |
Parses a
Rect string.
static
|
ToString |
string |
Returns the string representation of the rectangle.
|
TransformToAABB |
Rect |
Returns the axis-aligned bounding box of a transformed rectangle.
|
Translate |
Rect |
Translates the rectangle by an offset.
|
Union |
Rect |
Gets the union of two rectangles.
|
WithHeight |
Rect |
Returns a new
Rect with the specified height.
|
WithWidth |
Rect |
Returns a new
Rect with the specified width.
|
WithX |
Rect |
Returns a new
Rect with the specified X position.
|
WithY |
Rect |
Returns a new
Rect with the specified Y position.
|
Operators
Extension Methods
Name | Value | Summary |
---|---|---|
Align |
Rect |
Aligns a rect in a constraining rect according to horizontal and vertical alignment
settings.
From LayoutExtensions
|