New to Kendo UI for AngularStart a free 30-day trial

Rect

Class

Represents a rectangle with a set origin (top-left corner) and size(see example).

Definition

Package:@progress/kendo-drawing

Methods

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:otherRect

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:aPoint

The first point.

bPoint

The second point.

Returns:

Rect

  • The new Rect instance.

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:cornerRadiusnumber | 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:originPoint | number[]

The new origin Point or an equivalent [x, y] array.

Returns:

Rect

  • The current Rect instance.

Sets the size of the rectangle.

Parameters:sizenumber[] | 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:aRect

The first rectangle.

bRect

The second rectangle.

Returns:

Rect

  • The new Rect instance.

Gets the rectangle width.

Returns:

number

  • The rectangle width.

Properties

cornerRadius

number[]

The size of the rectangle.

The origin (top-left corner) of the rectangle.

The size of the rectangle.