Skip to content

Commit

Permalink
fix PHP8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck ALARY committed Jul 29, 2023
1 parent 3438934 commit bd17e2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ private function convertPosX($posX, int $width = 0): int
case static::ALIGN_LEFT:
return 0;
case static::ALIGN_CENTER:
return \round($this->width / 2 - $width / 2);
return $this->width / 2 - $width / 2;
case static::ALIGN_RIGHT:
return $this->width - $width;
}
return $posX;
return \round($posX);
}

/**
Expand All @@ -400,11 +400,11 @@ private function convertPosY($posY, int $height = 0): int
case static::ALIGN_TOP:
return 0;
case static::ALIGN_MIDDLE:
return \round($this->height / 2 - $height / 2);
return $this->height / 2 - $height / 2;
case static::ALIGN_BOTTOM:
return $this->height - $height;
}
return $posY;
return \round($posY);
}

//===============================================================================================================================
Expand Down Expand Up @@ -772,7 +772,7 @@ public function setOpacity(float $opacity): Image

\imagealphablending($this->image, false);
\imagesavealpha($this->image, true);
\imagefilter($this->image, IMG_FILTER_COLORIZE, 0, 0, 0, 127 * (1 - $opacity));
\imagefilter($this->image, IMG_FILTER_COLORIZE, 0, 0, 0, \round(127 * (1 - $opacity)));

return $this;
}
Expand Down

0 comments on commit bd17e2a

Please sign in to comment.