Craft\ImagerService::_getCropPoint PHP Method

_getCropPoint() private method

Gets crop point
private _getCropPoint ( Imagine\Image\Box $resizeSize, Imagine\Image\Box $cropSize, $transform ) : Imagine\Image\Point
$resizeSize Imagine\Image\Box
$cropSize Imagine\Image\Box
$transform
return Imagine\Image\Point
    private function _getCropPoint($resizeSize, $cropSize, $transform)
    {
        // find the "area of opportunity", the difference between the resized image size and the crop size
        $wDiff = $resizeSize->getWidth() - $cropSize->getWidth();
        $hDiff = $resizeSize->getHeight() - $cropSize->getHeight();
        // get default crop position from the settings
        $position = $this->getSetting('position', $transform);
        // get the offsets, left and top, now as an int, representing the % offset
        list($leftOffset, $topOffset) = explode(' ', $position);
        // calculate and return the point
        return new \Imagine\Image\Point(floor($wDiff * ($leftOffset / 100)), floor($hDiff * ($topOffset / 100)));
    }