Skip to content

Commit

Permalink
Update Avatar.php
Browse files Browse the repository at this point in the history
  • Loading branch information
labomatik authored Apr 3, 2021
1 parent 3ab66e3 commit 185b4cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Avatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,19 @@ public function save($path, $quality = 90)
return $this->image->save($path, $quality);
}

public function toSvg()
public function toSvg($customWidth=null,$customHeight)
{
$this->buildInitial();

$x = $y = $this->borderSize / 2;
$width = $height = $this->width - $this->borderSize;
$radius = ($this->width - $this->borderSize) / 2;
$center = $this->width / 2;

if(!is_null($customWidth))
$this->width = $customWidth;
if(!is_null($customHeight))
$this->height = $customHeight;

$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="'.$this->width.'" height="'.$this->height.'" viewBox="0 0 '.$this->width.' '.$this->height.'">';

Expand Down

0 comments on commit 185b4cb

Please sign in to comment.