source: trunk/client/inc/hpdf5/spipu/html2pdf/src/Tag/Svg/Ellipse.php@ 347

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.4 KB
Line 
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 */
12namespace Spipu\Html2Pdf\Tag\Svg;
13
14use Spipu\Html2Pdf\Tag\AbstractSvgTag;
15
16/**
17 * Tag Ellipse
18 */
19class Ellipse extends AbstractSvgTag
20{
21 /**
22 * @inheritdoc
23 */
24 public function getName()
25 {
26 return 'ellipse';
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 $rx = 0.;
48 if (isset($properties['rx'])) {
49 $rx = $this->cssConverter->convertToMM($properties['rx'], $this->svgDrawer->getProperty('w'));
50 }
51
52 $ry = 0.;
53 if (isset($properties['ry'])) {
54 $ry = $this->cssConverter->convertToMM($properties['ry'], $this->svgDrawer->getProperty('h'));
55 }
56
57 $this->pdf->svgEllipse($cx, $cy, $rx, $ry, $style);
58 }
59}
Note: See TracBrowser for help on using the repository browser.