projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eee806a
)
Small bug: when selPoints_ is empty, pointClickCallback is always called
author
Robert Konigsberg
<konigsberg@google.com>
Wed, 25 May 2011 18:59:10 +0000
(14:59 -0400)
committer
Robert Konigsberg
<konigsberg@google.com>
Wed, 25 May 2011 18:59:10 +0000
(14:59 -0400)
because closestDistance < 5*5. So make it MAX_NUM. We could probably
remove the closestIdx == 1 too.
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
6adb43b
..
e3e8daa
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-1333,7
+1333,7
@@
Dygraph.Interaction.treatMouseOpAsClick = function(g, event, context) {
if (g.attr_('pointClickCallback')) {
// check if the click was on a particular point.
var closestIdx = -1;
- var closestDistance =
0
;
+ var closestDistance =
Number.MAX_VALUE
;
for (var i = 0; i < g.selPoints_.length; i++) {
var p = g.selPoints_[i];
var distance = Math.pow(p.canvasx - context.dragEndX, 2) +