Skip to content

Commit

Permalink
Revert "Casting values to in after round() method which returns float"
Browse files Browse the repository at this point in the history
This reverts commit c37fbef.
  • Loading branch information
eduard13 committed Jul 25, 2018
1 parent de55247 commit ce18fd2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,8 @@ protected function _adaptResizeValues($frameWidth, $frameHeight)

// define position in center
// TODO: add positions option
$dstY = (int) round(($frameHeight - $dstHeight) / 2);
$dstX = (int) round(($frameWidth - $dstWidth) / 2);
$dstY = round(($frameHeight - $dstHeight) / 2);
$dstX = round(($frameWidth - $dstWidth) / 2);

// get rid of frame (fallback to zero position coordinates)
if (!$this->_keepFrame) {
Expand Down Expand Up @@ -595,9 +595,9 @@ protected function _checkAspectRatio($frameWidth, $frameHeight)
}
// keep aspect ratio
if ($this->_imageSrcWidth / $this->_imageSrcHeight >= $frameWidth / $frameHeight) {
$dstHeight = (int) round($dstWidth / $this->_imageSrcWidth * $this->_imageSrcHeight);
$dstHeight = round($dstWidth / $this->_imageSrcWidth * $this->_imageSrcHeight);
} else {
$dstWidth = (int) round($dstHeight / $this->_imageSrcHeight * $this->_imageSrcWidth);
$dstWidth = round($dstHeight / $this->_imageSrcHeight * $this->_imageSrcWidth);
}
}
return [$dstWidth, $dstHeight];
Expand Down

0 comments on commit ce18fd2

Please sign in to comment.