From fbff6d71498de79d95df32c4c3005c0139c88788 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Thu, 17 Nov 2011 17:23:48 -0500 Subject: [PATCH] Patch for issue 242 from kberg --- dygraph-interaction-model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dygraph-interaction-model.js b/dygraph-interaction-model.js index 06655f1..98d1411 100644 --- a/dygraph-interaction-model.js +++ b/dygraph-interaction-model.js @@ -266,7 +266,8 @@ Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) { var p = g.selPoints_[i]; var distance = Math.pow(p.canvasx - context.dragEndX, 2) + Math.pow(p.canvasy - context.dragEndY, 2); - if (closestIdx == -1 || distance < closestDistance) { + if (!isNaN(distance) && + (closestIdx == -1 || distance < closestDistance)) { closestDistance = distance; closestIdx = i; } -- 2.7.4