From 1d8f4807b3fb3660cd84d2e742753f180ff8c4ba Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Thu, 6 Mar 2008 17:54:12 +0000 Subject: [PATCH] Clamp the minimum zoom level in the example git-svn-id: https://flot.googlecode.com/svn/trunk@52 1e0a6537-2640-0410-bfb7-f154510ff394 --- examples/zooming.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/zooming.html b/examples/zooming.html index ecc242d..8ed5605 100644 --- a/examples/zooming.html +++ b/examples/zooming.html @@ -66,6 +66,12 @@ $(function () { var internalSelection = false; $("#placeholder").bind("selected", function (event, area) { + // clamp the zooming to prevent eternal zoom + if (area.x2 - area.x1 < 0.00001) + area.x2 = area.x1 + 0.00001; + if (area.y2 - area.y1 < 0.00001) + area.y2 = area.y1 + 0.00001; + // do the zooming plot = $.plot($("#placeholder"), getData(area.x1, area.x2), $.extend(true, {}, options, {