From 420c0ccda96310cf83199308fbf73c465c8b2cfe Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Tue, 28 Jul 2009 20:35:06 +0000 Subject: [PATCH] Fixed bug #42434 (ImageLine w/ antialias = 1px shorter) - patch by wojjie at gmail dot com --- NEWS | 4 +++- ext/gd/libgd/gd.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 0c0f939e575c0..0b21084a4700d 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -PHP NEWS +PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2009, PHP 5.2.11 - Fixed regression in cURL extension that prevented flush of data to output @@ -67,6 +67,8 @@ PHP NEWS (Sriram Natarajan) - Fixed bug #48182 (ssl handshake fails during asynchronous socket connection). (Sriram Natarajan) +- Fixed bug #42434 (ImageLine w/ antialias = 1px shorter). (wojjie at gmail dot + com, Kalle) 17 Jun 2009, PHP 5.2.10 - Updated timezone database to version 2009.9 (2009i) (Derick) diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 874dd1d1f4ee1..eb3668e2150f5 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -1351,7 +1351,7 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col) x = x1 << 16; y = y1 << 16; inc = (dy * 65536) / dx; - while ((x >> 16) < x2) { + while ((x >> 16) <= x2) { gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF); if ((y >> 16) + 1 < im->sy) { gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF); @@ -1373,7 +1373,7 @@ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col) x = x1 << 16; y = y1 << 16; inc = (dx * 65536) / dy; - while ((y>>16) < y2) { + while ((y>>16) <= y2) { gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF); if ((x >> 16) + 1 < im->sx) { gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);