Returns true if either of the width or height are less than or equal to zero.
Returns true if both the width or height are zero.
Returns true if both width and height values are equal to zero to within 4 decimal places of precision.
Sets the top left coordinates of this rectangle to origin and returns itself.
Sets the top left coordinates of this rectangle to x and y and returns itself.
If y is undefined then value of x is used for both dimensions.
Optionaly: numberSets the size of this rectangle to width and height and returns itself.
If height is undefined then value of width is used for both dimensions.
Optionalheight: numberResets origin and size of this Rectangle instance to 0s and returns itself.
Returns true if this rectangle's origin and size are equal to other rectangle's origin and size.
Returns true if this rectangle's origin and size are equal to other rectangle's origin and size to within epsilon decimal places of precision.
Adds given offsets to a copy of this rectangle and returns the copy.
Adds origin to both origin coordinates and right and bottom to size coordinates of this instance and returns itself.
Adds given values to this rectangle's coordinates and returns this instance.
Moves the x,y origin of the rectangle by the given offset. Returns itself.
Moves the x,y origin of the rectangle by the given amounts. If y is undefined then x value is added to both dimensions. Returns itself.
Optionaly: numberScales this rectangle's origin.x and size.width by factor.x and origin.y and size.height by factor.y values. Returns itself.
Scales this rectangle's origin and size by factor. Returns itself.
Scales this rectangle's origin.x and size.width by factorX and origin.y and size.height by factorY values.
StaticfromStaticfromCreates a new instance of Rectangle from a "bounds" type object where origin coordinate properties are left/top instead of x/y.
Optionalbounds: { left: number; top: number; width: number; height: number }StaticadjustedStaticadjustStaticunitedStaticuniteStatictranslateStaticscaleStatic[has
A rectangle type storing x, y, with, & height values. Convenience methods are provided for various operations.
The values are stored as
origin(Vect2dtype) andsize(Sizetype) properties which can be read or manipulated directly using their respective methods.