Returns a new Rectangle
with the given position and size.
Returns a new Rectangle
at the origin point and given size.
Parses a JSON string representation of a Rectangle and returns an object.
A JSON string, either in the form [x,y,width,height]
or {"x": 0, "y": 0, "width": 10, "height": 10}
A parsed Point.
Returns a new Rectangle
with the given position and size.
Returns true
if the given rectangle has a landscape aspect ratio.
Returns true
if the given rectangle has a portrait aspect ratio.
Returns true
if the given rectangle has a square aspect ratio.
Returns a rectangle where the position and dimensions are scaled by the given
factors. If scaleY
is omitted, then the position and dimensions are scaled
uniformly by scaleOrScaleX
.
The rectangle to scale.
The uniform scale factor, or the horizontal scale factor.
The vertical scale factor.
A scaled rectangle.
Returns a rectangle where each side of rect
will be reduced proportionally
to have an area less than or equal to the provided to
value. The returned
rectangle will be centered within the original bounds of rect
.
the maximum area this rectangle can have
the rectangle to scale to fit the specified area
Returns the area of the rectangle.