libgd
libgd copied to clipboard
Use gdImageDashedLine for dashed line but shift 1 pixel in mistake
version : 2.2.5 I create a image in size of 64*64, and paint two diagonal dashed line. code like this:
gdImagePtr im;
im = gdImageCreate(64,64);
int white;
gdImageColorAllocate(im, 0, 0, 0);
white = gdImageColorAllocate(im, 255, 255, 255);
gdImageDashedLine(im, 0, 64, 64, 0, white);
gdImageDashedLine(im, 0, 0, 64, 64, white);
FILE *pngout;
pngout = fopen("gd/test_exp.png", "wb");
gdImagePng(im, pngout);
fclose(pngout);
gdImageDestroy(im);
but one of the two lines is wrong to shifts 1 pixel :
gdImageDashedLine(im, 0, 64, 64, 0, white);
Besides, #435 is related to this issue. If gdImageDashedLine is deprecated, shall we solve this bug? @vapier