mxRectangle

Implements a 2-dimensional rectangle with double precision coordinates.

Summary
mxRectangleImplements a 2-dimensional rectangle with double precision coordinates.
Variables
widthHolds the width of the rectangle.
heightHolds the height of the rectangle.
Functions
mxRectangleConstructs a new rectangle for the optional parameters.
setRectSets this rectangle to the specified values.
getCenterXReturns the x-coordinate of the center point.
getCenterYReturns the y-coordinate of the center point.
addAdds the given rectangle to this rectangle.
growGrows 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.
equalsReturns true if the given object equals this rectangle.
copyReturns a copy of this mxRectangle.

Variables

width

var $width

Holds the width of the rectangle.  Default is 0.

height

var $height

Holds the height of the rectangle.  Default is 0.

Functions

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.

add

function add($rect)

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.
function add($rect)
Adds the given rectangle to this rectangle.
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.
function equals($obj)
Returns true if the given object equals this rectangle.
function copy()
Returns a copy of this mxRectangle.
Close