Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | <?php\r |
2 | \r | |
3 | class ofc_arrow\r | |
4 | {\r | |
5 | /**\r | |
6 | *@param $x as number. Start x position\r | |
7 | *@param $y as number. Start y position\r | |
8 | *@param $a as number. End x position\r | |
9 | *@param $b as number. End y position\r | |
10 | *@param $colour as string.\r | |
11 | *@param $barb_length as number. Length of the barbs in pixels.\r | |
12 | *@param $stroke as number. Width of the arrow in pixels.\r | |
13 | */\r | |
14 | function ofc_arrow($x, $y, $a, $b, $colour, $barb_length=10, $stroke=1)\r | |
15 | {\r | |
16 | $this->type = "arrow";\r | |
17 | $this->start = array("x"=>$x, "y"=>$y);\r | |
18 | $this->end = array("x"=>$a, "y"=>$b);\r | |
19 | $this->colour($colour);\r | |
20 | $this->{"barb-length"} = $barb_length;\r | |
21 | $this->{"stroke"} = $stroke;\r | |
22 | }\r | |
23 | \r | |
24 | function colour( $colour )\r | |
25 | {\r | |
26 | $this->colour = $colour;\r | |
27 | return $this;\r | |
28 | }\r | |
29 | }\r |