diff --git gd-2.0.33/gd.c b/BUILD/gd-2.0.33/gd.c index 8c309b6..d2615fc 100644 --- gd-2.0.33/gd.c +++ gd-2.0.33/gd.c @@ -1518,10 +1518,31 @@ BGD_DECLARE(void) gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int i; int lx = 0, ly = 0; int fx = 0, fy = 0; - while (e < s) - { - e += 360; - } + + if ((s % 360) == (e % 360)) { + s = 0; e = 360; + } else { + if (s > 360) { + s = s % 360; + } + + if (e > 360) { + e = e % 360; + } + + while (s < 0) { + s += 360; + } + + while (e < s) { + e += 360; + } + + if (s == e) { + s = 0; e = 360; + } + } + for (i = s; (i <= e); i++) { int x, y; @@ -1531,7 +1552,7 @@ BGD_DECLARE(void) gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, { if (!(style & gdChord)) { - if (style & gdNoFill) + if (style & gdNoFill) { gdImageLine (im, lx, ly, x, y, color); }