Skip to content

Commit 5881ad5

Browse files
committed
Rehover
1 parent 05e3687 commit 5881ad5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/plots/cartesian/graph_interact.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,13 @@ fx.init = function(gd) {
114114
var maindrag = dragBox(gd, plotinfo, 0, 0,
115115
xa._length, ya._length, 'ns', 'ew');
116116

117-
gd._lastMoveEvt;
118117
maindrag.onmousemove = function(evt) {
119-
gd._lastMoveEvt = evt;
120-
fx.hover(gd, evt, subplot);
118+
// This is on `gd._fullLayout`, *not* fullLayout because the reference
119+
// changes by the time this is called again.
120+
gd._fullLayout._rehover = function() {
121+
fx.hover(gd, evt, subplot);
122+
};
123+
gd._fullLayout._rehover();
121124
fullLayout._lasthover = maindrag;
122125
fullLayout._hoversubplot = subplot;
123126
};
@@ -132,13 +135,10 @@ fx.init = function(gd) {
132135
maindrag.onmouseout = function(evt) {
133136
if(gd._dragging) return;
134137

135-
gd._lastMoveEvt = null;
136-
137138
dragElement.unhover(gd, evt);
138139
};
139140

140141
maindrag.onclick = function(evt) {
141-
if(gd._lastMoveEvt) fx.hover(gd, gd._lastMoveEvt, subplot);
142142
fx.click(gd, evt);
143143
};
144144

src/plots/plots.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,4 +2026,6 @@ plots.doCalcdata = function(gd, traces) {
20262026

20272027
calcdata[i] = cd;
20282028
}
2029+
2030+
if(gd._fullLayout._rehover) gd._fullLayout._rehover();
20292031
};

0 commit comments

Comments
 (0)