size(width, [height])

Class: Rectangle.

Description:

Sets or gets the size of the Rectangle.

Parameters:

Name Type Description

width

number | Size

Width of the Rectangle, or a Size object (e.g., {width:300,height:300}).

[height]

number

Height of the Rectangle.

Returns:

If called without parameters, current size is returned; otherwise this Rectangle object is returned.

Type: Size | Rectangle

Also See: