Pop\Image\Svg::drawCircle PHP Метод

drawCircle() публичный Метод

Method to add a circle to the image.
public drawCircle ( integer $x, integer $y, integer $w ) : Svg
$x integer
$y integer
$w integer
Результат Svg
    public function drawCircle($x, $y, $w)
    {
        $circle = $this->resource->addChild('circle');
        $circle->addAttribute('cx', $x . $this->units);
        $circle->addAttribute('cy', $y . $this->units);
        $circle->addAttribute('r', $w . $this->units);
        $circle = $this->setStyles($circle);
        return $this;
    }

Usage Example

Пример #1
0
 public function testAddCircle()
 {
     $s = new Svg('graph.svg', '640px', '480px');
     $s->drawCircle(10, 10, 100);
     $this->assertEquals(640, $s->getWidth());
 }