composer package updates
[openemr.git] / vendor / phenx / php-svg-lib / src / Svg / Tag / Line.php
blob42504bca510ca027c32112fe900768eb495e993b
1 <?php
2 /**
3 * @package php-svg-lib
4 * @link http://github.com/PhenX/php-svg-lib
5 * @author Fabien Ménager <fabien.menager@gmail.com>
6 * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html
7 */
9 namespace Svg\Tag;
11 class Line extends Shape
13 protected $x1 = 0;
14 protected $y1 = 0;
16 protected $x2 = 0;
17 protected $y2 = 0;
19 public function start($attributes)
21 if (isset($attributes['x1'])) {
22 $this->x1 = $attributes['x1'];
24 if (isset($attributes['y1'])) {
25 $this->y1 = $attributes['y1'];
27 if (isset($attributes['x2'])) {
28 $this->x2 = $attributes['x2'];
30 if (isset($attributes['y2'])) {
31 $this->y2 = $attributes['y2'];
34 $surface = $this->document->getSurface();
35 $surface->moveTo($this->x1, $this->y1);
36 $surface->lineTo($this->x2, $this->y2);