]> granicus.if.org Git - php/commitdiff
- Fix #28506, negative angle returns "random arcs"
authorPierre Joye <pajoye@php.net>
Mon, 24 May 2004 19:52:28 +0000 (19:52 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 24 May 2004 19:52:28 +0000 (19:52 +0000)
  while (angle < 0) angle += 2*M_PI is used now

ext/gd/libgd/gd.c

index c3f3be822d0da7a6ecb00f4c93e46d8ba2335f09..c127928cba52dfd3f9468685b6b82a0c1eb5d85c 100644 (file)
@@ -1605,9 +1605,14 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e
        int lx = 0, ly = 0;
        int fx = 0, fy = 0;
 
+       while (s<0) {
+               s += 360;
+       }
+
        while (e < s) {
                e += 360;
        }
+
        for (i = s; i <= e; i++) {
                int x, y;
                x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx;