1 diff -up gd-2.0.35/gd.c.AALineThick gd-2.0.35/gd.c
2 --- gd-2.0.35/gd.c.AALineThick 2007-06-19 22:25:51.000000000 +0200
3 +++ gd-2.0.35/gd.c 2012-02-28 11:02:09.708015922 +0100
4 @@ -3474,6 +3474,8 @@ static void gdImageAALine (gdImagePtr im
5 /* keep them as 32bits */
9 + int thick = im->thick;
12 /* TBB: don't crash when the image is of the wrong type */
13 @@ -3502,6 +3504,25 @@ static void gdImageAALine (gdImagePtr im
14 gdImageSetAAPixelColor(im, x1, y1, col, 0xFF);
19 + if (abs(dy) < abs(dx))
20 + ag = cos (atan2 (dy, dx));
22 + ag = sin (atan2 (dy, dx));
25 + wid = abs(thick / ag);
36 if (abs(dx) > abs(dy)) {
39 @@ -3518,8 +3539,11 @@ static void gdImageAALine (gdImagePtr im
40 inc = (dy * 65536) / dx;
41 /* TBB: set the last pixel for consistency (<=) */
42 while ((x >> 16) <= x2) {
43 - gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF);
44 - gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF);
45 + wstart = (y >> 16) - wid / 2;
46 + for (w = wstart; w < wstart + wid; w++) {
47 + gdImageSetAAPixelColor(im, (x >> 16) , w , col , (y >> 8) & 0xFF);
48 + gdImageSetAAPixelColor(im, (x >> 16) , w + 1 , col, (~y >> 8) & 0xFF);
53 @@ -3539,8 +3563,11 @@ static void gdImageAALine (gdImagePtr im
54 inc = (dx * 65536) / dy;
55 /* TBB: set the last pixel for consistency (<=) */
56 while ((y>>16) <= y2) {
57 - gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF);
58 - gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF);
59 + wstart = (x >> 16) - wid / 2;
60 + for (w = wstart; w < wstart + wid; w++) {
61 + gdImageSetAAPixelColor(im, w , y >> 16 , col, (x >> 8) & 0xFF);
62 + gdImageSetAAPixelColor(im, w + 1, y >> 16, col, (~x >> 8) & 0xFF);