summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2004-05-24 20:03:08 +0000
committerPierre Joye <pajoye@php.net>2004-05-24 20:03:08 +0000
commit30b2af951128cb522dabeed775c8baf7091efebb (patch)
tree638152ab6e96d520133db797ee5a95d72a57552f
parent03edfa1677a0827a0d391a54213b5c485105ac08 (diff)
downloadphp-git-30b2af951128cb522dabeed775c8baf7091efebb.tar.gz
- MFH: Fix #28506, negative angle returns "random arcs"
while (s < 0) s += 360 is used now
-rw-r--r--NEWS2
-rw-r--r--ext/gd/libgd/gd.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index e7e52dc0b9..55aee1e592 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ PHP 4 NEWS
and/or HTTP_SESSION_VARS. (Sara)
- Fixed bug #28508 (Do not make hypot() available if not supported by libc).
(Ilia)
+- Fixed bug #28506 (Allow negative start angle in imagearc and imagefilledarc.
+ (Pierre)
- Fixed bug #28386 (wordwrap() wraps lines 1 character too soon). (Ilia)
- Fixed bug #28374 (Possible unterminated loop inside
_php_pgsql_trim_message()). (Ilia)
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 5ad1f12e87..3eb846cee1 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1607,9 +1607,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;