RectExtensions
Methods related to the Rect class.
Definition
Namespace:Telerik.Windows.Diagrams.Core
Assembly:Telerik.Windows.Diagrams.Core.dll
Syntax:
public static class RectExtensions
Inheritance: objectRectExtensions
Properties
RotateTransform
RotateTransform
Simple RotateTransform.
public static RotateTransform RotateTransform { get; set; }
Methods
Returns the bottom left point.
public static Point BottomLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
The rectangle.
angledoubleThe angle.
rotationOffsetPointThe rotation offset.
pointOffsetPointThe point offset.
Returns:Point
Returns the rotated bottom left point.
public static Point BottomLeft(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
The rect.
transformationOriginPointThe transform origin.
angledoubleThe angle.
pointOffsetPointThe point offset.
Returns:Point
Returns the bottom-left point of the rectangle.
public static Point BottomLeft(this Rect rect)
The current rectangle.
Returns:Point
Returns the bottoms right point.
public static Point BottomRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
The rectangle.
angledoubleThe angle.
rotationOffsetPointThe rotation offset.
pointOffsetPointThe point offset.
Returns:Point
Returns the rotated bottom right point.
public static Point BottomRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
The rect.
transformationOriginPointThe transform origin.
angledoubleThe angle.
pointOffsetPointThe point offset.
Returns:Point
Returns the bottom-right corner of the rectangle.
public static Point BottomRight(this Rect rect)
The current rectangle.
Returns:Point
Returns the rotated center point.
public static Point Center(this Rect rect, double angle, Point offsetVector = null)
The rectangle.
angledoubleThe angle.
offsetVectorPointThe offset vector.
Returns:Point
Returns the rotated center point.
public static Point Center(this Rect rect, Point transformationOrigin, double angle)
The rect.
transformationOriginPointThe transform origin.
angledoubleThe angle.
Returns:Point
Returns the center of the specified rectangle.
public static Point Center(this Rect rectangle)
Point
Centers the bottom.
public static Point CenterBottom(this Rect rect, double angle, Point offsetVector = null)
The rectangle.
angledoubleThe angle.
offsetVectorPointThe offset vector.
Returns:Point
Returns the bottom center point.
public static Point CenterBottom(this Rect rect)
The rectangle.
Returns:Point
Returns the rotated left center point.
public static Point CenterLeft(this Rect rect, double angle, Point offsetVector = null)
The rectangle.
angledoubleThe angle.
offsetVectorPointThe offset vector.
Returns:Point
Centers the left.
public static Point CenterLeft(this Rect rect)
The rectangle.
Returns:Point
Centers the right.
public static Point CenterRight(this Rect rect, double angle, Point offsetVector = null)
The object.
angledoubleThe angle.
offsetVectorPointThe offset vector.
Returns:Point
Centers the right.
public static Point CenterRight(this Rect rect)
The rectangle.
Returns:Point
Returns the rotated top center point.
public static Point CenterTop(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
The rectangle.
angledoubleThe angle.
rotationOffsetPointThe rotation offset.
pointOffsetPointThe point offset.
Returns:Point
Returns the rotated top center point.
public static Point CenterTop(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
The rect.
transformationOriginPointThe rotation origin.
angledoubleThe angle.
pointOffsetPointThe point offset.
Returns:Point
Centers the top.
public static Point CenterTop(this Rect rect)
The rectangle.
Returns:Point
Returns the X coordinate of the centers.
Returns the Y coordinate of the center.
Determines whether [contains] [the specified rectangle].
Determines whether the specified rect1 contains the rect2 parameter.
public static bool Contains(this Rect rect1, Rect rect2)
Inflates the given rectangle with the specified amount.
public static Rect InflateRect(this Rect rect, double delta)
Rect
Inflates the specified rectangle.
public static Rect InflateRect(this Rect rect, Size size)
The rectangle.
sizeSizeThe size.
Returns:Rect
Calculate the intersection point between an ellipse and a line segment.
public static Point IntersectionPoint(this Rect rectangle, Point point1, Point point2)
Point
Intersects the line segment.
public static bool IntersectsLineSegment(this Rect rect, Point lineStart, Point lineEnd, ref Point point)
Determines whether the start bounds intersect with the given rectangle.
Returns whether the given rectangle intersects the current one.
public static bool IntersectsWith(this Rect rect1, Rect rect2)
The first rectangle.
rect2RectThe queried rectangle which potentially intersects.
Returns:Determines whether the specified rectangle is bigger.
public static bool IsBigger(this Rect rect, Rect targetRect)
The rectangle.
targetRectRectThe target rectangle.
Returns:True if the specified rectangle is bigger; otherwise, false.
Gets whether the rectangle is fully in bounds of the hosting rectangle.
public static bool IsInBounds(this Rect rect, Rect hostingRect)
The rectangle.
hostingRectRectThe hosting rectangle.
Returns:Returns true if the rectangle is fully inside the bounds for the hosting rectangle.
Determines whether the specified rect is zero - does not have size.
public static bool IsNotZero(this Rect rect)
The rectangle.
Returns:True if the specified rect is zero; otherwise, false.
Determines whether the bounds are valid.
Offsets the specified rectangle.
public static Rect OffsetRect(this Rect rect, Vector offsetVector)
The rectangle.
offsetVectorVectorThe offset vector.
Returns:Rect
Calculates the pivot point of the specified rectangle.
public static Point Pivot(this Rect rect, Point origin)
The rect.
originPointThe transformation origin.
Returns:Point
Gets the relative point against the rectangle by offset.
public static Point RelativePoint(this Rect rect, Point offset)
The rectangle.
offsetPointThe offset.
Returns:Point
Rotates the specified rectangle.
public static Rect Rotate(this Rect rect, double angle, Point offsetVector = null)
The rectangle.
angledoubleThe angle.
offsetVectorPointThe offset vector.
Returns:Rect
Rotates the specified rectangle.
public static Point[] Rotate(this Rect rect, Point pivot, double angle)
The rectangle.
pivotPointThe pivot.
angledoubleThe angle.
Returns:Point[]
Rotates the specified rectangle.
public static Rect RotateRect(this Rect rect, double angle, Point pivot)
The rect.
angledoubleThe angle.
pivotPointThe pivot.
Returns:Rect
Rotates the specified rect.
public static Rect RotateRect(this Rect rect, Point origin, double angle)
The rect.
originPointThe transformation origin.
angledoubleThe angle.
Returns:Rect
Rotations the point.
public static Point RotationPoint(this Rect rect, double angle, Point offsetVector = null)
The rectangle.
angledoubleThe angle.
offsetVectorPointThe offset vector.
Returns:Point
Returns the top left point.
public static Point TopLeft(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
The rectangle.
angledoubleThe angle.
rotationOffsetPointThe rotation offset.
pointOffsetPointThe point offset.
Returns:Point
Returns the rotated top left point.
public static Point TopLeft(this Rect rect, Point transformOrigin, double angle, Point pointOffset = null)
The rect.
transformOriginPointThe transform origin.
angledoubleThe angle.
pointOffsetPointThe point offset.
Returns:Point
Returns the top-left point of the rectangle.
public static Point TopLeft(this Rect rect)
The current rectangle.
Returns:Point
Returns the top right point.
public static Point TopRight(this Rect rect, double angle, Point rotationOffset = null, Point pointOffset = null)
The rectangle.
angledoubleThe angle.
rotationOffsetPointThe rotation offset.
pointOffsetPointThe point offset.
Returns:Point
Returns the rotated top right point.
public static Point TopRight(this Rect rect, Point transformationOrigin, double angle, Point pointOffset = null)
The rect.
transformationOriginPointThe transform origin.
angledoubleThe angle.
pointOffsetPointThe point offset.
Returns:Point
Returns the top-right point of the rectangle.
public static Point TopRight(this Rect rect)
The current rectangle.
Returns:Point
Toes the size.
public static Size ToSize(this Rect rect)
The rectangle.
Returns:Size