From fc4256eb48fcbd91ba4de09081c0464f547b88b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B8=CC=86?= Date: Mon, 2 Jan 2017 22:14:29 +1000 Subject: [PATCH] fix: The Image::setOpacity method returns wrong result when opacity = 0 --- src/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Image.php b/src/Image.php index 3cd4df9..14e368d 100755 --- a/src/Image.php +++ b/src/Image.php @@ -397,7 +397,7 @@ function setOpacity( $opacity ) return $this; } - $restLayersOpacity = ceil( $opacity ) - 1; + $restLayersOpacity = max( ceil( $opacity ) - 1, 0 ); $firstLayerOpacity = $opacity - $restLayersOpacity; $bitmap = static::copyBitmap( $this->bitmap );