source: trunk/client/inc/hpdf5/spipu/html2pdf/src/Tag/Svg/Line.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 Line
18 */
19class Line extends AbstractSvgTag
20{
21 /**
22 * @inheritdoc
23 */
24 public function getName()
25 {
26 return 'line';
27 }
28
29 /**
30 * @inheritdoc
31 */
32 protected function drawSvg($properties)
33 {
34 $styles = $this->parsingCss->getSvgStyle($this->getName(), $properties);
35 $styles['fill'] = null;
36 $this->pdf->svgSetStyle($styles);
37
38 $x1 = 0.;
39 if (isset($properties['x1'])) {
40 $x1 = $this->cssConverter->convertToMM($properties['x1'], $this->svgDrawer->getProperty('w'));
41 }
42
43 $y1 = 0.;
44 if (isset($properties['y1'])) {
45 $y1 = $this->cssConverter->convertToMM($properties['y1'], $this->svgDrawer->getProperty('h'));
46 }
47
48 $x2 = 0.;
49 if (isset($properties['x2'])) {
50 $x2 = $this->cssConverter->convertToMM($properties['x2'], $this->svgDrawer->getProperty('w'));
51 }
52
53 $y2 = 0.;
54 if (isset($properties['y2'])) {
55 $y2 = $this->cssConverter->convertToMM($properties['y2'], $this->svgDrawer->getProperty('h'));
56 }
57
58 $this->pdf->svgLine($x1, $y1, $x2, $y2);
59 }
60}
Note: See TracBrowser for help on using the repository browser.