New to Kendo UI for Angular? Start a free 30-day trial
Represents a rectangle with a set origin (top-left corner) and size(see example).
Name | Type | Default | Description |
---|
|
number[]
|
|
|
Point
|
|
|
Size
|
|
(origin: Point | number[], size: number[] | Size, cornerRadius?: number | number[])
Creates a rectangle geometry with the specified parameters.
Point | number[]
The origin (top-left corner) of the rectangle or an equivalent `[x, y]` array.
number[] | Size
The size of the rectangle or an equivalent `[width, height]` array.
number | number[]
The corner radius of the rectangle as a single number or an `[rx, ry]` array.
|
---|
Returns the bounding box of this rectangle after applying the specified transformation matrix.
|
Parameters | | |
---|
matrix?
|
Matrix
|
The transformation matrix to apply.
|
|
Returns | |
---|
Rect
|
- The bounding box after applying the transformation matrix.
|
|
|
---|
Gets the position of the bottom-left corner of the rectangle. This is also the rectangle origin.
|
Returns | |
---|
Point
|
- The position of the bottom-left corner.
|
|
|
---|
Gets the position of the bottom-right corner of the rectangle.
|
Returns | |
---|
Point
|
- The position of the bottom-right corner.
|
|
|
---|
Gets the position of the center of the rectangle.
|
Returns | |
---|
Point
|
- The position of the center.
|
|
|
---|
Creates a new instance with the same origin and size.
|
Returns | |
---|
Rect
|
- A new Rect instance with the same origin and size.
|
|
|
---|
Compares this rectangle with another instance.
|
Parameters | | |
---|
other
|
Rect
|
The rectangle to compare with.
|
|
Returns | |
---|
boolean
|
true if the origin and size is the same for both rectangles. Otherwise, returns false .
|
|
|
---|
Creates a Rect instance that contains the points given as arguments.
|
Parameters | | |
---|
a
|
Point
|
The first point.
|
b
|
Point
|
The second point.
|
|
|
|
---|
Gets the origin (top-left point) of the rectangle.
|
Returns | |
---|
Point
|
- The origin (top-left point).
|
|
|
---|
Gets the rectangle size.
|
Returns | |
---|
Size
|
- The current Size of the rectangle.
|
|
|
---|
Gets the height of the rectangle.
|
Returns | |
---|
number
|
- The height of the rectangle.
|
|
|
---|
Sets the corner radius of the rectangle.
|
Parameters | | |
---|
cornerRadius
|
number | number[]
|
The new corner radius of the rectangle as a single number or an [rx, ry] array.
|
|
Returns | |
---|
Rect
|
- The current rectangle instance.
|
|
|
---|
Sets the origin (top-left point) of the rectangle.
|
Parameters | | |
---|
origin
|
Point | number[]
|
The new origin Point or an equivalent [x, y] array.
|
|
Returns | |
---|
Rect
|
- The current Rect instance.
|
|
|
---|
Sets the size of the rectangle.
|
Parameters | | |
---|
size
|
number[] | Size
|
The new rectangle Size or an equivalent [width, height] array.
|
|
Returns | |
---|
Rect
|
- The current rectangle instance.
|
|
|
---|
Gets the position of the top-left corner of the rectangle. This is also the rectangle origin.
|
Returns | |
---|
Point
|
- The position of the top-left corner.
|
|
|
---|
Gets the position of the top-right corner of the rectangle.
|
Returns | |
---|
Point
|
- The position of the top-right corner.
|
|
|
---|
Creates a new Rect instance that encloses the two rectangles given as arguments.
|
Parameters | | |
---|
a
|
Rect
|
The first rectangle.
|
b
|
Rect
|
The second rectangle.
|
|
|
|
---|
Gets the rectangle width.
|
|