dimensions::fit

Recalculates the width and height to fit into the given box.

dimensions::fit($box, $force = false)

Parameters

$box (int)
the max width and/or height
$force (boolean)
If true, the dimensions will be upscaled to fit the box if smaller

Return values

object
returns this object with recalculated dimensions