Last change
on this file since 347 was 347, checked in by roby, 3 years ago |
Aggiornamento per compatibilità con php7.4
|
File size:
1.2 KB
|
Rev | Line | |
---|
[347] | 1 | <?php
|
---|
| 2 | /**
|
---|
| 3 | * Html2Pdf Library - Tag class
|
---|
| 4 | *
|
---|
| 5 | * HTML => PDF converter
|
---|
| 6 | * distributed under the OSL-3.0 License
|
---|
| 7 | *
|
---|
| 8 | * @package Html2pdf
|
---|
| 9 | * @author Laurent MINGUET <webmaster@html2pdf.fr>
|
---|
| 10 | * @copyright 2017 Laurent MINGUET
|
---|
| 11 | */
|
---|
| 12 | namespace Spipu\Html2Pdf\Tag\Svg;
|
---|
| 13 |
|
---|
| 14 | use Spipu\Html2Pdf\Tag\AbstractSvgTag;
|
---|
| 15 |
|
---|
| 16 | /**
|
---|
| 17 | * Tag Circle
|
---|
| 18 | */
|
---|
| 19 | class Circle extends AbstractSvgTag
|
---|
| 20 | {
|
---|
| 21 | /**
|
---|
| 22 | * @inheritdoc
|
---|
| 23 | */
|
---|
| 24 | public function getName()
|
---|
| 25 | {
|
---|
| 26 | return 'circle';
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * @inheritdoc
|
---|
| 31 | */
|
---|
| 32 | protected function drawSvg($properties)
|
---|
| 33 | {
|
---|
| 34 | $styles = $this->parsingCss->getSvgStyle($this->getName(), $properties);
|
---|
| 35 | $style = $this->pdf->svgSetStyle($styles);
|
---|
| 36 |
|
---|
| 37 | $cx = 0.;
|
---|
| 38 | if (isset($properties['cx'])) {
|
---|
| 39 | $cx = $this->cssConverter->convertToMM($properties['cx'], $this->svgDrawer->getProperty('w'));
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | $cy = 0.;
|
---|
| 43 | if (isset($properties['cy'])) {
|
---|
| 44 | $cy = $this->cssConverter->convertToMM($properties['cy'], $this->svgDrawer->getProperty('h'));
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | $r = 0.;
|
---|
| 48 | if (isset($properties['r'])) {
|
---|
| 49 | $r = $this->cssConverter->convertToMM($properties['r'], $this->svgDrawer->getProperty('w'));
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | $this->pdf->svgEllipse($cx, $cy, $r, $r, $style);
|
---|
| 53 | }
|
---|
| 54 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.