public function fitHeight($height) { $this->_makeSource(); if ($this->_height > $height || $this->_height < $height && $this->_enlarge) { $box = new self(round($this->_width / $this->_height * $height), $height); $box->setSourceWidth($this->getWidth()); $box->setSourceHeight($this->getHeight()); return $box; } return $this; }