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 185b4cb commit 5d4e73d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Avatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ public function toSvg($customWidth=null,$customHeight)
$radius = ($this->width - $this->borderSize) / 2;
$center = $this->width / 2;

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

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

if ($this->shape == 'square') {
$svg .= '<rect x="'.$x
Expand Down

0 comments on commit 5d4e73d

Please sign in to comment.