From 1e050212c167320604f02de0826f2ebb076c8c77 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Fri, 11 Mar 2011 22:08:26 +0000 Subject: [PATCH] Fix bug in picking items when transform/inverseTransform is in use (reported by Ofri Raviv, and patches and analysis by Jan and Tom Paton, issue 334 and 467) git-svn-id: https://flot.googlecode.com/svn/trunk@307 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 3 +++ jquery.flot.js | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS.txt b/NEWS.txt index 6b2e57b..a753419 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -140,6 +140,9 @@ Bug fixes: correctly (fix by Mike, issue 263). - Fix bug in restoring cursor in navigate plugin (reported by Matteo Gattanini, issue 395). +- Fix bug in picking items when transform/inverseTransform is in use + (reported by Ofri Raviv, and patches and analysis by Jan and Tom + Paton, issue 334 and 467). Flot 0.6 diff --git a/jquery.flot.js b/jquery.flot.js index 7f44d26..3a92dab 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -2217,6 +2217,13 @@ maxx = maxDistance / axisx.scale, maxy = maxDistance / axisy.scale; + // with inverse transforms, we can't use the maxx/maxy + // optimization, sadly + if (axisx.options.inverseTransform) + maxx = Number.MAX_VALUE; + if (axisy.options.inverseTransform) + maxy = Number.MAX_VALUE; + if (s.lines.show || s.points.show) { for (j = 0; j < points.length; j += ps) { var x = points[j], y = points[j + 1];