summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2021-08-27 01:23:26 +0700
committerGitHub <noreply@github.com>2021-08-27 01:23:26 +0700
commit0bc3170fa7b8cb74868ab477652b541a91ac391d (patch)
treeb46e5960e987a9eaa3b78effe880cb1f4235e218 /src
parent127e2975649f1db14973457de266b65802c306a0 (diff)
parente8642aa54eae7da310e41f56fbf895279e036e58 (diff)
downloadlibgd-0bc3170fa7b8cb74868ab477652b541a91ac391d.tar.gz
Merge pull request #741 from mvorisek/patch-1
Fix gdAlphaMax limit typo
Diffstat (limited to 'src')
-rw-r--r--src/gd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gd.c b/src/gd.c
index 51d87d1..4c1c3b6 100644
--- a/src/gd.c
+++ b/src/gd.c
@@ -3543,7 +3543,7 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst,
red = red >= 255.5 ? 255 : red+0.5;
blue = blue >= 255.5 ? 255 : blue+0.5;
green = green >= 255.5 ? 255 : green+0.5;
- alpha = alpha >= gdAlphaMax+0.5 ? 255 : alpha+0.5;
+ alpha = alpha >= gdAlphaMax+0.5 ? gdAlphaMax : alpha+0.5;
gdImageSetPixel(dst, x, y, gdTrueColorAlpha ((int)red, (int)green, (int)blue, (int)alpha));
}
}