rect.maxRectUniformScaleToFit(limitRectangle [, origin])

Returns a number that specifies the maximum scaling that can be applied to the rectangle along both axes so that it would still fit into limitRectangle.

If origin is specified, the rectangle is scaled around it; otherwise, it is scaled around its center.