mxRectangle

Extends mxPoint to implement a 2-dimensional rectangle with double precision coordinates.

Summary
mxRectangleExtends mxPoint to implement a 2-dimensional rectangle with double precision coordinates.
Functions
mxRectangleConstructs a new rectangle for the optional parameters.
Variables
widthHolds the width of the rectangle.
heightHolds the height of the rectangle.
Functions
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.
intersectChanges this rectangle to where it overlaps with the given 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.
getPointReturns the top, left corner as a new mxPoint.
rotate90Rotates this rectangle by 90 degree around its center point.
equalsReturns true if the given object equals this rectangle.
fromRectangleReturns a new mxRectangle which is a copy of the given rectangle.

Functions

mxRectangle

function mxRectangle(x,
y,
width,
height)

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

Variables

width

mxRectangle.prototype.width

Holds the width of the rectangle.  Default is 0.

height

mxRectangle.prototype.height

Holds the height of the rectangle.  Default is 0.

Functions

setRect

mxRectangle.prototype.setRect = function(x,
y,
w,
h)

Sets this rectangle to the specified values

getCenterX

mxRectangle.prototype.getCenterX = function ()

Returns the x-coordinate of the center point.

getCenterY

mxRectangle.prototype.getCenterY = function ()

Returns the y-coordinate of the center point.

add

mxRectangle.prototype.add = function(rect)

Adds the given rectangle to this rectangle.

intersect

mxRectangle.prototype.intersect = function(rect)

Changes this rectangle to where it overlaps with the given rectangle.

grow

mxRectangle.prototype.grow = function(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.

getPoint

mxRectangle.prototype.getPoint = function()

Returns the top, left corner as a new mxPoint.

rotate90

mxRectangle.prototype.rotate90 = function()

Rotates this rectangle by 90 degree around its center point.

equals

mxRectangle.prototype.equals = function(obj)

Returns true if the given object equals this rectangle.

fromRectangle

mxRectangle.fromRectangle = function(rect)

Returns a new mxRectangle which is a copy of the given rectangle.

Implements a 2-dimensional vector with double precision coordinates.
function mxRectangle(x,
y,
width,
height)
Constructs a new rectangle for the optional parameters.
mxRectangle.prototype.width
Holds the width of the rectangle.
mxRectangle.prototype.height
Holds the height of the rectangle.
mxRectangle.prototype.setRect = function(x,
y,
w,
h)
Sets this rectangle to the specified values
mxRectangle.prototype.getCenterX = function ()
Returns the x-coordinate of the center point.
mxRectangle.prototype.getCenterY = function ()
Returns the y-coordinate of the center point.
mxRectangle.prototype.add = function(rect)
Adds the given rectangle to this rectangle.
mxRectangle.prototype.intersect = function(rect)
Changes this rectangle to where it overlaps with the given rectangle.
mxRectangle.prototype.grow = function(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.
mxRectangle.prototype.getPoint = function()
Returns the top, left corner as a new mxPoint.
mxRectangle.prototype.rotate90 = function()
Rotates this rectangle by 90 degree around its center point.
mxRectangle.prototype.equals = function(obj)
Returns true if the given object equals this rectangle.
mxRectangle.fromRectangle = function(rect)
Returns a new mxRectangle which is a copy of the given rectangle.
Close