gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / gd-brect-bounds.patch
1 Revert upstream commit 04bb9a08b3c25f8e3c0c235f9cefc0f94df59a5a because it
2 causes a test failure on i686 and possibly other architectures.
3
4 See <https://github.com/libgd/libgd/issues/613>.
5
6 diff --git a/src/gdft.c b/src/gdft.c
7 --- a/src/gdft.c
8 +++ b/src/gdft.c
9 @@ -1579,6 +1579,12 @@ BGD_DECLARE(char *) gdImageStringFTEx (gdImage * im, int *brect, int fg, const c
10 double scalex = (double)hdpi / (64 * METRIC_RES);
11 double scaley = (double)vdpi / (64 * METRIC_RES);
12
13 + /* increase by 1 pixel to allow for rounding */
14 + total_min.x -= METRIC_RES;
15 + total_min.y -= METRIC_RES;
16 + total_max.x += METRIC_RES;
17 + total_max.y += METRIC_RES;
18 +
19 /* rotate bounding rectangle, scale and round to int pixels, and translate */
20 brect[0] = x + (total_min.x * cos_a + total_max.y * sin_a)*scalex;
21 brect[1] = y - (total_min.x * sin_a - total_max.y * cos_a)*scaley;
22 diff --git a/tests/gdimagestringft/gdimagestringft_bbox.c b/tests/gdimagestringft/gdimagestringft_bbox.c
23 --- a/tests/gdimagestringft/gdimagestringft_bbox.c
24 +++ b/tests/gdimagestringft/gdimagestringft_bbox.c
25 @@ -8,22 +8,22 @@
26 #define DELTA (PI/8)
27
28 static int EXPECT[16][8] = {
29 - {500, 400, 628, 400, 628, 376, 500, 376},
30 - {492, 362, 611, 312, 601, 290, 483, 339},
31 - {470, 330, 561, 239, 544, 221, 453, 312},
32 - {437, 308, 486, 189, 464, 180, 414, 299},
33 - {400, 301, 400, 173, 376, 173, 376, 301},
34 - {363, 309, 313, 190, 291, 200, 340, 318},
35 - {332, 331, 241, 240, 223, 257, 314, 348},
36 - {311, 363, 192, 314, 183, 336, 302, 386},
37 - {304, 399, 176, 399, 176, 423, 304, 423},
38 - {312, 435, 193, 485, 203, 507, 321, 458},
39 - {333, 465, 242, 556, 259, 574, 350, 483},
40 - {364, 486, 315, 605, 337, 614, 387, 495},
41 - {399, 492, 399, 620, 423, 620, 423, 492},
42 - {434, 484, 484, 603, 506, 593, 457, 475},
43 - {463, 464, 554, 555, 572, 538, 481, 447},
44 - {483, 434, 602, 483, 611, 461, 492, 411},
45 + {498, 401, 630, 401, 630, 374, 498, 374},
46 + {491, 364, 613, 313, 602, 288, 481, 338},
47 + {470, 332, 563, 239, 544, 219, 451, 312},
48 + {438, 310, 488, 189, 463, 178, 412, 300},
49 + {401, 303, 401, 171, 374, 171, 374, 303},
50 + {365, 310, 314, 188, 289, 199, 339, 320},
51 + {334, 331, 241, 238, 221, 257, 314, 350},
52 + {313, 362, 192, 312, 181, 337, 303, 388},
53 + {306, 398, 174, 398, 174, 425, 306, 425},
54 + {313, 433, 191, 484, 202, 509, 323, 459},
55 + {333, 463, 240, 556, 259, 576, 352, 483},
56 + {363, 484, 313, 605, 338, 616, 389, 494},
57 + {398, 490, 398, 622, 425, 622, 425, 490},
58 + {432, 483, 483, 605, 508, 594, 458, 473},
59 + {461, 464, 554, 557, 574, 538, 481, 445},
60 + {481, 435, 602, 485, 613, 460, 491, 409},
61 };
62
63 int main()