From 147f940e5b3f75e810dced367b3b5a2877a05b5c Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Wed, 15 Dec 2010 15:55:23 +0000 Subject: [PATCH] Fix problem with floating point comparison (report and patch by jparish9001) git-svn-id: https://flot.googlecode.com/svn/trunk@286 1e0a6537-2640-0410-bfb7-f154510ff394 --- jquery.flot.pie.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index 4b1a074..70941dd 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -403,7 +403,7 @@ More detail and specific examples can be found in the included HTML file. } ctx.beginPath(); - if (angle!=Math.PI*2) + if (Math.abs(angle - Math.PI*2) > 0.000000001) ctx.moveTo(0,0); // Center of the pie else if ($.browser.msie) angle -= 0.0001; @@ -688,7 +688,7 @@ More detail and specific examples can be found in the included HTML file. octx.fillStyle = "rgba(255, 255, 255, "+options.series.pie.highlight.opacity+")"; // this is temporary until we have access to parseColor octx.beginPath(); - if (series.angle!=Math.PI*2) + if (Math.abs(series.angle - Math.PI*2) > 0.000000001) octx.moveTo(0,0); // Center of the pie octx.arc(0,0,radius,series.startAngle,series.startAngle+series.angle,false); octx.closePath();