fitWithin

Scales this size down to fit maximum without changing its aspect ratio.

The result never enlarges this size. Fractional dimensions are truncated and each result dimension is kept at one pixel or greater.

Throws

when this size or maximum is empty