From f32c746a2ae0694c9f8e7e3090f9325a04d252e6 Mon Sep 17 00:00:00 2001 From: rjohnson Date: Sat, 17 Apr 1999 01:09:33 +0000 Subject: Fixed bug 1479 --- generic/tkCanvArc.c | 12 +++++++++--- 1 file 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 @@ -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 { -- cgit v0.12