summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrjohnson <rjohnson>1999-04-17 01:09:33 (GMT)
committerrjohnson <rjohnson>1999-04-17 01:09:33 (GMT)
commitf32c746a2ae0694c9f8e7e3090f9325a04d252e6 (patch)
tree96abc8ebd8837d576fad1aef8dfdf8c92abde4f8
parente9ec045e67f48872c9f930085515d9d36df3694b (diff)
downloadtk-f32c746a2ae0694c9f8e7e3090f9325a04d252e6.zip
tk-f32c746a2ae0694c9f8e7e3090f9325a04d252e6.tar.gz
tk-f32c746a2ae0694c9f8e7e3090f9325a04d252e6.tar.bz2
Fixed bug 1479
-rw-r--r--generic/tkCanvArc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/generic/tkCanvArc.c b/generic/tkCanvArc.c
index 1b9e4e9..effbc4f 100644
--- a/generic/tkCanvArc.c
+++ b/generic/tkCanvArc.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvArc.c,v 1.4 1999/04/16 01:51:11 stanton Exp $
+ * RCS: @(#) $Id: tkCanvArc.c,v 1.5 1999/04/17 01:09:33 rjohnson Exp $
*/
#include <stdio.h>
@@ -749,8 +749,14 @@ ArcToPoint(canvas, itemPtr, pointPtr)
vertex[0] = (arcPtr->bbox[0] + arcPtr->bbox[2])/2.0;
vertex[1] = (arcPtr->bbox[1] + arcPtr->bbox[3])/2.0;
- t1 = (pointPtr[1] - vertex[1])/(arcPtr->bbox[3] - arcPtr->bbox[1]);
- t2 = (pointPtr[0] - vertex[0])/(arcPtr->bbox[2] - arcPtr->bbox[0]);
+ t1 = arcPtr->bbox[3] - arcPtr->bbox[1];
+ if (t1 != 0.0) {
+ t1 = (pointPtr[1] - vertex[1]) / t1;
+ }
+ t2 = arcPtr->bbox[2] - arcPtr->bbox[0];
+ if (t2 != 0.0) {
+ t2 = (pointPtr[0] - vertex[0]) / t2;
+ }
if ((t1 == 0.0) && (t2 == 0.0)) {
pointAngle = 0;
} else {