Commit 1d8f4807 authored by olau@iola.dk's avatar olau@iola.dk

Clamp the minimum zoom level in the example

git-svn-id: https://flot.googlecode.com/svn/trunk@52 1e0a6537-2640-0410-bfb7-f154510ff394
parent 7a665a14
...@@ -66,6 +66,12 @@ $(function () { ...@@ -66,6 +66,12 @@ $(function () {
var internalSelection = false; var internalSelection = false;
$("#placeholder").bind("selected", function (event, area) { $("#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 // do the zooming
plot = $.plot($("#placeholder"), getData(area.x1, area.x2), plot = $.plot($("#placeholder"), getData(area.x1, area.x2),
$.extend(true, {}, options, { $.extend(true, {}, options, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment