Skip to content

Commit

Permalink
Check if $this->height is zero
Browse files Browse the repository at this point in the history
Add zero check before divizion
  • Loading branch information
surger authored and Progi1984 committed Oct 14, 2019
1 parent fa28cf1 commit 2b7d4ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpPresentation/Shape/AbstractGraphic.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function setWidth($pValue = 0)
public function setHeight($pValue = 0)
{
// Resize proportional?
if ($this->resizeProportional && $pValue != 0) {
if ($this->resizeProportional && $pValue != 0 && $this->height != 0) {
$ratio = $this->width / $this->height;
$this->width = (int) round($ratio * $pValue);
}
Expand Down

0 comments on commit 2b7d4ff

Please sign in to comment.