Skip to content

Commit 7ce88c1

Browse files
committed
Fix combined mousewheel/drag gesture.
During a combined zoom/pan gesture, controlled via simultaneous use of the mousewheel and dragging, it is possible for the drag to finish before the use of the mousewheel finishes. The mousewheel gesture is deemed to be finished if 50ms passes with no mousewheel event. Although the "zoomend" event is only dispatched when *both* gestures have finished, the variable "center0" was being reset when *either* gesture was finished, causing an error in the mousewheel handler. Fixes d3#2205.
1 parent 3abb001 commit 7ce88c1

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

d3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,8 +1463,7 @@
14631463
function zoomended(dispatch) {
14641464
if (!--zooming) dispatch({
14651465
type: "zoomend"
1466-
});
1467-
center0 = null;
1466+
}), center0 = null;
14681467
}
14691468
function mousedowned() {
14701469
var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);

0 commit comments

Comments
 (0)