Rect
Represents a rectangle with position and dimensions. Provides methods for geometric operations and transformations.
Definition
Package:@progress/kendo-angular-diagrams
Methods
Gets the bottom center point of the rectangle.
A Point at the bottom center edge
Gets the bottom-left corner point of the rectangle.
A Point at the bottom-left corner
Gets the bottom-right corner point of the rectangle.
A Point at the bottom-right corner
Gets the center point of the rectangle.
A Point representing the center of the rectangle
Creates a copy of this rectangle.
A new Rect with the same position and dimensions
Determines if a point is contained within this rectangle.
The point to test
Returns:boolean
True if the point is inside the rectangle, false otherwise
Creates an empty rectangle (zero position and dimensions).
A new empty Rect instance
Determines if this rectangle is equal to another rectangle.
The rectangle to compare with
Returns:boolean
True if both rectangles have the same position and dimensions
Inflates the rectangle by the specified amounts.
The amount to inflate horizontally
dy?anyThe amount to inflate vertically (defaults to dx if not provided)
Returns:this
This rectangle instance for chaining
Determines if this rectangle is empty (zero width and height).
boolean
True if the rectangle has no area, false otherwise
Moves the rectangle by the specified offset.
The horizontal offset (or a Point object)
dyanyThe vertical offset (ignored if dx is a Point)
Returns:this
This rectangle instance for chaining
Determines if this rectangle overlaps with another rectangle.
The rectangle to check for overlap
Returns:boolean
True if the rectangles overlap, false otherwise
Calculates the bounding rectangle after rotating this rectangle by a given angle.
The rotation angle in radians
Returns:A new Rect representing the axis-aligned bounding box of the rotated rectangle
Gets the four corner points of this rectangle after rotation.
The rotation angle in radians
Returns:Point[]
An array of four Points representing the rotated corners [topLeft, topRight, bottomRight, bottomLeft]
Scales this rectangle while maintaining a static reference point.
The horizontal scale factor
scaleYanyThe vertical scale factor
staicPointanyThe static point that should remain fixed during scaling
adornerCenteranyThe center point of the adorner
angleanyThe rotation angle to apply during scaling
Gets the top-left corner point of the rectangle.
A Point at the top-left corner
Gets the top-right corner point of the rectangle.
A Point at the top-right corner
Converts an object to a Rect instance.
Returns a string representation of this rectangle.
The delimiter to use between values (defaults to space)
Returns:any
A string in the format "x y width height" (or with custom delimiter)
Creates a new rectangle that is the union of this rectangle and another.
The rectangle to union with
Returns:A new Rect representing the union of both rectangles
Scales this rectangle by a zoom factor.
The zoom factor to apply
Returns:this
This rectangle instance for chaining