maxAspectRatioInSize
Determine the maximum size of rectangle with a given aspect ratio (X/Y) that can fit inside the specified area.
For example, if the aspect ratio is 1/2 and the area is 2x2, the resulting rectangle would be size 1x2 and look like this:
________
| | | |
| | | |
| | | |
|_|____|_|
Content copied to clipboard