Commit d479d340 authored by olau@iola.dk's avatar olau@iola.dk

Fix problem with locking and sensitivity to mouse events (fix by

fdepuydt, issue 332)


git-svn-id: https://flot.googlecode.com/svn/trunk@255 1e0a6537-2640-0410-bfb7-f154510ff394
parent 467b9545
...@@ -105,14 +105,14 @@ The plugin also adds four public methods: ...@@ -105,14 +105,14 @@ The plugin also adds four public methods:
}); });
eventHolder.mousemove(function (e) { eventHolder.mousemove(function (e) {
if (crosshair.locked)
return;
if (plot.getSelection && plot.getSelection()) { if (plot.getSelection && plot.getSelection()) {
crosshair.x = -1; // hide the crosshair while selecting crosshair.x = -1; // hide the crosshair while selecting
return; return;
} }
if (crosshair.locked)
return;
var offset = plot.offset(); var offset = plot.offset();
crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width())); crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));
crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height())); crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));
......
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