- fix hline and vline calls
  - add test case
master
pajoye 2007-05-07 10:26:44 +00:00
parent 8b49ad512e
commit 57d7bf4a6a
5 changed files with 40 additions and 3 deletions

View File

@ -1610,6 +1610,7 @@ BGD_DECLARE(void) gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h,
{
e += 360;
}
for (i = s; (i <= e); i++)
{
int x, y;
@ -3456,10 +3457,10 @@ static void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int co
/* Axis aligned lines */
if (dx == 0) {
gdImageHLine(im, y1, x1, x2, col);
gdImageVLine(im, x1, y1, y2, col);
return;
} else if (dy == 0) {
gdImageVLine(im, x1, y1, y2, col);
gdImageHLine(im, y1, x1, x2, col);
return;
}

View File

@ -28,6 +28,7 @@ if (BUILD_TEST)
SET(TESTS_DIRS
gdtest
gdimagearc
gdimagecolorclosest
gdimagecolorexact
gdimagecolorresolve
@ -50,4 +51,4 @@ if (BUILD_TEST)
FOREACH(test_dir ${TESTS_DIRS})
add_subdirectory (${test_dir})
ENDFOREACH(test_dir)
endif (BUILD_TEST)
endif (BUILD_TEST)

View File

@ -0,0 +1,9 @@
SET(TESTS_FILES
bug00079
)
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest ${GD_LIB})
ADD_TEST(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
ENDFOREACH(test_name)

View File

@ -0,0 +1,26 @@
#include "gd.h"
#include "gdtest.h"
int main()
{
gdImagePtr im;
FILE *fp;
int error = 0;
char path[1024];
im = gdImageCreateTrueColor(300, 300);
gdImageFilledRectangle(im, 0,0, 299,299, 0xFFFFFF);
gdImageSetAntiAliased(im, 0x000000);
gdImageArc(im, 300, 300, 600,600, 0, 360, gdAntiAliased);
sprintf(path, "%s/gdimagearc/bug00079_exp.png", GDTEST_TOP_DIR);
if (!gdAssertImageEqualsToFile(path, im)) {
printf("%s failed\n", path);
error = 1;
}
gdImageDestroy(im);
return error;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB