root/cleversvg/trunk/gradients/csRadialGradient.class.php

Revision 318, 1.6 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 radial gradient class
4  *
5  * @author     Nicolas Perriault <nperriault@gmail.com>
6  * @package    cleversvg
7  * @subpackage gradients
8  */
9 class csRadialGradient extends csBaseGradient
10 {
11
12   protected
13     $stops         = array(),
14     $xml_node_name = 'radialGradient';
15
16   /**
17    * Class constructor
18    *
19    */
20   public function __construct($cx=null, $cy=null, $fx=null, $fy=null, $r=null, $attrs=array())
21   {
22     $this->setCx($cx);
23     $this->setCy($cy);
24     $this->setFx($fx);
25     $this->setFy($fy);
26     $this->setRadius($r);
27     $this->attributes = array_merge($attrs, $this->attributes);
28   }
29  
30   /**
31    * The start x-axis coordinate of the gradient center point (can be a
32    * percentage)
33    *
34    * @param  mixed
35    */
36   public function setCx($cx)
37   {
38     $this->setAttribute('cx', $cx);
39   }
40  
41   /**
42    * The start y-axis coordinate of the gradient center point (can be a
43    * percentage)
44    *
45    * @param  mixed
46    */
47   public function setCy($cy)
48   {
49     $this->setAttribute('cy', $cy);
50   }
51  
52   /**
53    * The end x-axis coordinate of the finish gradient point (can be a
54    * percentage)
55    *
56    * @param  mixed
57    */
58   public function setFx($fx)
59   {
60     $this->setAttribute('fx', $fx);
61   }
62  
63   /**
64    * The end y-axis coordinate of the finish gradient point (can be a
65    * percentage)
66    *
67    * @param  mixed
68    */
69   public function setFy($fy)
70   {
71     $this->setAttribute('fy', $fy);
72   }
73  
74   /**
75    * Sets the radius of the radial gradient (can be a percentage)
76    *
77    * @param  int  $radius
78    */
79   public function setRadius($radius)
80   {
81     $this->setAttribute('r', $radius);
82   }
83  
84 }
85
Note: See TracBrowser for help on using the browser.