From: Dan Vanderkam Date: Thu, 17 Nov 2011 22:23:48 +0000 (-0500) Subject: Patch for issue 242 from kberg X-Git-Tag: v1.0.0~412 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=fbff6d71498de79d95df32c4c3005c0139c88788;p=dygraphs.git Patch for issue 242 from kberg --- 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; }