From 9108c292c7ca9533e02a72cece8abbecfd452614 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Tue, 5 Feb 2013 18:17:22 -0500 Subject: [PATCH] Avoid rounding errors with intersection points. This resolves #895. --- jquery.flot.threshold.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.flot.threshold.js b/jquery.flot.threshold.js index f265bc2..3cc015d 100644 --- a/jquery.flot.threshold.js +++ b/jquery.flot.threshold.js @@ -78,7 +78,7 @@ You may need to check for this in hover events. if (addCrossingPoints && prevp != p && x != null && i > 0 && origpoints[i - ps] != null) { - var interx = (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]) * (below - y) + x; + var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]); prevp.push(interx); prevp.push(below); for (m = 2; m < ps; ++m)