File: bug00351.c

package info (click to toggle)
libgd2 2.3.3-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,396 kB
  • sloc: ansic: 49,708; sh: 5,660; javascript: 1,859; cpp: 1,308; makefile: 345; perl: 197; tcl: 45
file content (30 lines) | stat: -rw-r--r-- 777 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
 * Test drawing of pies starting and/or ending near 90°
 *
 * See <https://github.com/libgd/libgd/issues/351>.
 */


#include "gd.h"
#include "gdtest.h"


int main()
{
    gdImagePtr im;
    int white, navy, red;

    im = gdImageCreateTrueColor(500, 500);
    white = gdTrueColorAlpha(0xFF, 0xFF, 0xFF, gdAlphaOpaque);
    navy = gdTrueColorAlpha(0x00, 0x00, 0x80, gdAlphaOpaque);
    red = gdTrueColorAlpha(0xFF, 0x00, 0x00, gdAlphaOpaque);

    gdImageFilledArc(im, 250, 250, 500, 250, 0, 88, white, gdPie);
    gdImageFilledArc(im, 250, 250, 500, 250, 88, 91 , navy, gdPie);
    gdImageFilledArc(im, 250, 250, 500, 250, 91, 360 , red, gdPie);

    gdAssertImageEqualsToFile("gdimagefilledarc/bug00351_exp.png", im);

    gdImageDestroy(im);
	return gdNumFailures();
}