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
11 class Line
extends Shape
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
);