root/cleversvg/trunk/elements/csLine.class.php

Revision 318, 1.0 kB (checked in by nperriault, 11 months ago)

refs #41 - classes autoloading

  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * SVG Line class
4  *
5  * @author     Nicolas Perriault <nperriault@gmail.com>
6  * @package    cleversvg
7  * @subpackage elements
8  */
9 class csLine extends csBaseShape
10 {
11
12   protected $xml_node_name = 'line';
13
14   /**
15    * Class constructor
16    *
17    */
18   public function __construct($x1=null, $y1=null, $x2=null, $y2=null, $attrs=array())
19   {
20     $this->setX1($x1);
21     $this->setY1($y1);
22     $this->setX2($x2);
23     $this->setY2($y2);
24     $this->attributes = array_merge($attrs, $this->attributes);
25   }
26  
27   /**
28    * The start x-axis coordinate of the line
29    *
30    */
31   public function setX1($x1)
32   {
33     $this->setAttribute('x1', $x1);
34   }
35  
36   /**
37    * The start y-axis coordinate of the line
38    *
39    */
40   public function setY1($y1)
41   {
42     $this->setAttribute('y1', $y1);
43   }
44  
45   /**
46    * The end x-axis coordinate of the line
47    *
48    */
49   public function setX2($x2)
50   {
51     $this->setAttribute('x2', $x2);
52   }
53  
54   /**
55    * The end y-axis coordinate of the line
56    *
57    */
58   public function setY2($y2)
59   {
60     $this->setAttribute('y2', $y2);
61   }
62  
63 }
64
Note: See TracBrowser for help on using the browser.