# mxRectangle

Implements a 2-dimensional rectangle with double precision coordinates.

Summary
 mxRectangle Implements a 2-dimensional rectangle with double precision coordinates. Variables width Holds the width of the rectangle. height Holds the height of the rectangle. Functions mxRectangle Constructs a new rectangle for the optional parameters. setRect Sets this rectangle to the specified values. getCenterX Returns the x-coordinate of the center point. getCenterY Returns the y-coordinate of the center point. add Adds the given rectangle to this rectangle. grow Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height. equals Returns true if the given object equals this rectangle. copy Returns a copy of this mxRectangle.

### width

 var \$width

Holds the width of the rectangle.  Default is 0.

### height

 var \$height

Holds the height of the rectangle.  Default is 0.

### mxRectangle

 function mxRectangle( \$x = 0, \$y = 0, \$width = 0, \$height = 0 )

Constructs a new rectangle for the optional parameters.  If no parameters are given then the respective default values are used.

### setRect

 function setRect( \$x, \$y, \$width, \$height )

Sets this rectangle to the specified values.

### getCenterX

 function getCenterX()

Returns the x-coordinate of the center point.

### getCenterY

 function getCenterY()

Returns the y-coordinate of the center point.

Adds the given rectangle to this rectangle.

### grow

 function grow( \$amount )

Grows the rectangle by the given amount, that is, this method subtracts the given amount from the x- and y-coordinates and adds twice the amount to the width and height.

### equals

 function equals( \$obj )

Returns true if the given object equals this rectangle.

### copy

 function copy()

Returns a copy of this mxRectangle.

 var \$width
Holds the width of the rectangle.
 var \$height
Holds the height of the rectangle.
 function mxRectangle( \$x = 0, \$y = 0, \$width = 0, \$height = 0 )
Constructs a new rectangle for the optional parameters.
 function setRect( \$x, \$y, \$width, \$height )
Sets this rectangle to the specified values.
 function getCenterX()
Returns the x-coordinate of the center point.
 function getCenterY()
Returns the y-coordinate of the center point.