From e60344561f9891ad019b2811a5183ac5a4fe04d5 Mon Sep 17 00:00:00 2001 From: "Alexander O. Anisimov" Date: Fri, 27 Jan 2012 23:40:44 +0600 Subject: [PATCH] Fixed overrun panRange while zooming --- jquery.flot.navigate.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jquery.flot.navigate.js b/jquery.flot.navigate.js index 88d0a87..9e95cc9 100644 --- a/jquery.flot.navigate.js +++ b/jquery.flot.navigate.js @@ -234,7 +234,8 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L var opts = axis.options, min = minmax[axis.direction].min, max = minmax[axis.direction].max, - zr = opts.zoomRange; + zr = opts.zoomRange, + pr = opts.panRange; if (zr === false) // no zooming on this axis return; @@ -248,6 +249,16 @@ Licensed under the MIT License ~ http://threedubmedia.googlecode.com/files/MIT-L max = tmp; } + //Check that we are in panRange + if (pr) { + if (pr[0] != null && min < pr[0]) { + min = pr[0]; + } + if (pr[1] != null && max > pr[1]) { + max = pr[1]; + } + } + var range = max - min; if (zr && ((zr[0] != null && range < zr[0]) ||