StructRect
Axis-aligned rectangle defined by X, Y, Width, and Height used in geometry, layout, and hit‑testing.
Definition
Namespace:Telerik.Documents.Primitives
Assembly:Telerik.Windows.Documents.Core.dll
Syntax:
public struct Rect
Inherited Members
Constructors
Rect(double, double, double, double)
Initializes a new instance of the Rect structure.
Properties
BottomLeft
BottomLeft Property - This is a read-only alias for the Point which is at X, Y + Height If this is the empty rectangle, the value will be positive infinity, negative infinity.
BottomRight
BottomRight Property - This is a read-only alias for the Point which is at X + Width, Y + Height If this is the empty rectangle, the value will be negative infinity, negative infinity.
Left
Gets the value of the X coordinate.
Location
Gets or sets the coordinates of the upper-left corner of this Rect structure.
Size
Size - The Size representing the area of the Rectangle
Top
Gets the value of the Y coordinate.
TopLeft
TopLeft Property - This is a read-only alias for the Point which is at X, Y If this is the empty rectangle, the value will be positive infinity, positive infinity.
TopRight
TopRight Property - This is a read-only alias for the Point which is at X + Width, Y If this is the empty rectangle, the value will be negative infinity, positive infinity.
Methods
Contains(Rect)
Contains - Returns true if the Rect non-Empty and is entirely contained within the rectangle, inclusive of the edges. Returns false otherwise
Contains(double, double)
Returns a value indicating whether the x, y coordinates are inside the rectangle, including the edges.
Equals(object)
Determines whether the specified object is equal to the current Rect.
GetHashCode()
Returns a hash code for the current Rect.
Declaration
public override int GetHashCode()
Returns
A hash code based on X, Y, Width, and Height; returns 0 for the Empty rectangle.
Overrides
Intersect(Rect)
Intersect - Update this rectangle to be the intersection of this and rect If either this or rect are Empty, the result is Empty as well.
Declaration
public void Intersect(Rect rect)
Parameters
rect
The rect to intersect with this
IntersectsWith(Rect)
IntersectsWith - Returns true if the Rect intersects with this rectangle Returns false otherwise. Note that if one edge is coincident, this is considered an intersection.
Union(Rect)
This Rect becomes a the result of union of this and otherRect.
Operators
operator !=(Rect, Rect)
Compares two Rect instances for exact inequality.
operator ==(Rect, Rect)
Compares two Rect instances for exact equality.