From 356a27b6601d214d9895b22bd09fdfc02d1447cc Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Wed, 28 Oct 2009 12:29:29 +0000 Subject: [PATCH] Fixed problem with findNearbyItem and bars on top of each other (reported by ragingchikn, issue 242) git-svn-id: https://flot.googlecode.com/svn/trunk@226 1e0a6537-2640-0410-bfb7-f154510ff394 --- Makefile | 2 +- NEWS.txt | 10 ++++++++++ jquery.flot.js | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f90a969..8bccbe8 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ YUICOMPRESSOR_PATH=../yuicompressor-2.3.5.jar .PHONY: all -# we cheat and process all .js files instead of listing them +# we cheat and process all .js files instead of an exhaustive list all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js))) %.min.js: %.js diff --git a/NEWS.txt b/NEWS.txt index 53281c5..7bb3922 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,13 @@ +Flot x.x +-------- + + +Bug fixes: + +- Fixed problem with findNearbyItem and bars on top of each other + (reported by ragingchikn, issue 242). + + Flot 0.6 -------- diff --git a/jquery.flot.js b/jquery.flot.js index 6534a46..3a05ca9 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1797,7 +1797,7 @@ smallestDistance = maxDistance * maxDistance + 1, item = null, foundPoint = false, i, j; - for (i = 0; i < series.length; ++i) { + for (i = series.length - 1; i >= 0; --i) { if (!seriesFilter(series[i])) continue; @@ -1831,7 +1831,7 @@ // use <= to ensure last point takes precedence // (last generally means on top of) - if (dist <= smallestDistance) { + if (dist < smallestDistance) { smallestDistance = dist; item = [i, j / ps]; }