public function drawEllipse($x, $y, $w, $h = null)
{
$ellipse = $this->resource->addChild('ellipse');
$ellipse->addAttribute('cx', $x . $this->units);
$ellipse->addAttribute('cy', $y . $this->units);
$ellipse->addAttribute('rx', $w . $this->units);
$ellipse->addAttribute('ry', (null === $h ? $w : $h) . $this->units);
$ellipse = $this->setStyles($ellipse);
return $this;
}
public function testAddEllipse() { $s = new Svg('graph.svg', '640px', '480px'); $s->setStrokeColor(new Rgb(0, 0, 0))->drawEllipse(10, 10, 100, 100); $s->setBackgroundColor(new Rgb(255, 0, 0)); $s->drawEllipse(10, 10, 100, 100); $s->setFillColor(new Rgb(255, 0, 0)); $s->drawEllipse(10, 10, 100, 100); $this->assertEquals(640, $s->getWidth()); }