drawPolygon() public method

Method to add a polygon to the image.
public drawPolygon ( array $points ) : Svg
$points array
return Svg
Exemplo n.º 1
0
 public function testAddPolygon()
 {
     $s = new Svg('graph.svg', '640px', '480px');
     $points = array(array('x' => 320, 'y' => 50), array('x' => 400, 'y' => 100), array('x' => 420, 'y' => 200), array('x' => 280, 'y' => 320), array('x' => 200, 'y' => 180));
     $s->setStrokeColor(new Rgb(0, 0, 0))->drawPolygon($points);
     $s->setBackgroundColor(new Rgb(255, 0, 0));
     $s->drawPolygon($points);
     $s->setFillColor(new Rgb(255, 0, 0));
     $s->drawPolygon($points);
     $this->assertEquals(640, $s->getWidth());
 }