/** * Get the location of the center of the arc * * @return Zend_Image_Point */ public function getLocation(Zend_Image_Adapter_AdapterAbstract $adapter = null) { if ($adapter !== null) { if ($this->_pointCenter->getX() === null) { $this->_pointCenter->setX($adapter->getWidth() / 2); } if ($this->_pointCenter->getY() === null) { $this->_pointCenter->setY($adapter->getHeight() / 2); } } return $this->_pointCenter; }
public function perform(Zend_Image_Adapter_AdapterAbstract $adapter) { $newX = $this->getXAmount(); $newY = $this->getYAmount(); if (null === $newX && null === $newY) { throw new Zend_Image_Action_Exception('No dimensions for resizing were specified, ' . 'at least one dimension should be specified.'); } $constrain = $this->hasConstrainedProportions(); if (null === $newX) { if ($constrain) { $newX = 0; } else { $newX = $adapter->getWidth(); } } elseif (self::TYPE_RELATIVE == $this->getXType()) { $newX *= $adapter->getWidth() / 100; } if (null === $newY) { if ($constrain) { $newY = 0; } else { $newY = $adapter->getHeight(); } } elseif (self::TYPE_RELATIVE == $this->getYType()) { $newY *= $adapter->getHeight() / 100; } $this->_yAmountCalculated = $newY; $this->_xAmountCalculated = $newX; return parent::perform($adapter); }