Ejemplo n.º 1
0
 /**
  * Set proportional width/height if one dimension not available.
  *
  * @param integer $actualWidth
  * @param integer $actualHeight
  * @return void
  */
 private function setProportionalSize($actualWidth, $actualHeight)
 {
     $styleWidth = $this->style->getWidth();
     $styleHeight = $this->style->getHeight();
     if (!($styleWidth && $styleHeight)) {
         if ($styleWidth == null && $styleHeight == null) {
             $this->style->setWidth($actualWidth);
             $this->style->setHeight($actualHeight);
         } elseif ($styleWidth) {
             $this->style->setHeight($actualHeight * ($styleWidth / $actualWidth));
         } else {
             $this->style->setWidth($actualWidth * ($styleHeight / $actualHeight));
         }
     }
 }