Skip to content

Kirby 3.7.5


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

$dimensions->fit(int $box, bool $force = false): Kirby\Image\Dimensions


Name Type Default Description
$box * int the max width and/or height
$force bool false If true, the dimensions will be
upscaled to fit the box if smaller

Return type


This method modifies the existing $dimensions object it is applied to and returns it again.

Parent class