Optional
x: string | numberOptional
y: string | numberThe Y coordinate of the upper-left corner of the rectangle
Optional
width: string | numberThe overall width of the rectangle
Optional
height: string | numberThe overall height of the rectangle
Readonly
typeThe type of the object, mainly used to avoid instanceof
checks
Returns the bottom edge of the rectangle.
Returns the left edge of the rectangle.
Returns the right edge of the rectangle.
Returns the top edge of the rectangle.
Static
EMPTYA constant empty rectangle.
Enlarges rectangle that way its corners lie on grid
Optional
resolution: numberresolution
Optional
eps: numberprecision
Returns itself.
Creates a clone of this Rectangle
a copy of the rectangle
Checks whether the x and y coordinates given are contained within this Rectangle
The X coordinate of the point to test
The Y coordinate of the point to test
Whether the x/y coordinates are within this Rectangle
Copies another rectangle to this one.
The rectangle to copy from.
Returns itself.
Copies this rectangle to another one.
The rectangle to copy to.
Returns given parameter.
Enlarges this rectangle to include the passed rectangle.
The rectangle to include.
Returns itself.
Fits this rectangle around the passed one.
The rectangle to fit.
Returns itself.
Determines whether the other
Rectangle transformed by transform
intersects with this
Rectangle object.
Returns true only if the area of the intersection is >0, this means that Rectangles
sharing a side are not overlapping. Another side effect is that an arealess rectangle
(width or height equal to zero) can't intersect any other rectangle.
The Rectangle to intersect with this
.
Optional
transform: MatrixThe transformation matrix of other
.
A value of true
if the transformed other
Rectangle intersects with this
; otherwise false
.
Pads the rectangle making it grow in all directions. If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
Optional
paddingX: numberThe horizontal padding amount.
Optional
paddingY: numberThe vertical padding amount.
Returns itself.
The X coordinate of the upper-left corner of the rectangle