Skip to content

Commit 05e3687

Browse files
committed
Cache the last mousemove event
1 parent 3b85f7f commit 05e3687

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/plots/cartesian/graph_interact.js

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

117+
gd._lastMoveEvt;
117118
maindrag.onmousemove = function(evt) {
119+
gd._lastMoveEvt = evt;
118120
fx.hover(gd, evt, subplot);
119121
fullLayout._lasthover = maindrag;
120122
fullLayout._hoversubplot = subplot;
@@ -130,10 +132,13 @@ fx.init = function(gd) {
130132
maindrag.onmouseout = function(evt) {
131133
if(gd._dragging) return;
132134

135+
gd._lastMoveEvt = null;
136+
133137
dragElement.unhover(gd, evt);
134138
};
135139

136140
maindrag.onclick = function(evt) {
141+
if(gd._lastMoveEvt) fx.hover(gd, gd._lastMoveEvt, subplot);
137142
fx.click(gd, evt);
138143
};
139144

0 commit comments

Comments
 (0)