Source of file Shape.php
Size: 1,561 Bytes - Last Modified: 2021-12-23T10:11:59+00:00
/var/www/docs.ssmods.com/process/src/ext/phenx/php-svg-lib/src/Svg/Tag/Shape.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php /** * @package php-svg-lib * @link http://github.com/PhenX/php-svg-lib * @author Fabien Ménager <fabien.menager@gmail.com> * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html */ namespace Svg\Tag; use Svg\Style; class Shape extends AbstractTag { protected function before($attributes) { $surface = $this->document->getSurface(); $surface->save(); $style = $this->makeStyle($attributes); $this->setStyle($style); $surface->setStyle($style); $this->applyTransform($attributes); } protected function after() { $surface = $this->document->getSurface(); if ($this->hasShape) { $style = $surface->getStyle(); $fill = $style->fill && is_array($style->fill); $stroke = $style->stroke && is_array($style->stroke); if ($fill) { if ($stroke) { $surface->fillStroke(); } else { // if (is_string($style->fill)) { // /** @var LinearGradient|RadialGradient $gradient */ // $gradient = $this->getDocument()->getDef($style->fill); // // var_dump($gradient->getStops()); // } $surface->fill(); } } elseif ($stroke) { $surface->stroke(); } else { $surface->endPath(); } } $surface->restore(); } } |