Pop\Image\Svg::drawClippingCircle PHP Method

drawClippingCircle() public method

Add a clipping circle.
public drawClippingCircle ( integer $x, integer $y, integer $w ) : Svg
$x integer
$y integer
$w integer
return Svg
    public function drawClippingCircle($x, $y, $w)
    {
        $this->curClippingPath = count($this->clippingPaths);
        $defs = $this->resource->addChild('defs');
        $clip = $defs->addChild('clipPath');
        $clip->addAttribute('id', 'clip' . $this->curClippingPath);
        $circle = $clip->addChild('circle');
        $circle->addAttribute('cx', $x . $this->units);
        $circle->addAttribute('cy', $y . $this->units);
        $circle->addAttribute('r', $w . $this->units);
        return $this;
    }

Usage Example

コード例 #1
0
ファイル: SvgTest.php プロジェクト: nicksagona/PopPHP
 public function testAddClippingCircle()
 {
     $s = new Svg('graph.svg', '640px', '480px');
     $s->drawClippingCircle(10, 10, 240);
     $this->assertEquals(640, $s->getWidth());
 }