fit() static public method

Fits width and height into a defined box and keeps the ratio
static public fit ( integer $width, integer $height, integer $box, boolean $force = false ) : array
$width integer
$height integer
$box integer
$force boolean If width and height are smaller than the box this will force upscaling
return array An array with a key and value for width and height
Example #1
0
 function fit($box, $force = false)
 {
     $size = size::fit($this->width(), $this->height(), $box, $force);
     $this->info->width = $size['width'];
     $this->info->height = $size['height'];
     return $this;
 }