Constructor
new Rectangle(leftopt, topopt, rightopt, bottomopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
left | number | <optional> | Left coordinate. 0 - default. |
top | number | <optional> | Top coordinate. 0 - default. |
right | number | <optional> | Right coordinate. 0 - default. |
bottom | number | <optional> | Bottom coordinate. 0 - default. |
- Source
Methods
clone() → {Rectangle}
Clone rectangle object.
- Source
Returns:
- Type:
- Rectangle
fit(width, height)
Returns true if rectangle fits their size in width and height.
Parameters:
Name | Type | Description |
---|---|---|
width | number | Width. |
height | number | Height. |
- Source
getDiagonal()
Returns rectangle diagonal size.
- Source
getHeight()
Returns rectangle height.
- Source
getSquare()
Returns rectangle area.
- Source
getWidth()
Returns rectangle width.
- Source