Patch d3's mousewheeled function

(closes #2773)
This commit is contained in:
Kushan Joshi
2016-06-08 18:07:20 +05:30
parent 3f1141af44
commit 71a3d3e4f6

5
js/lib/d3.v3.js vendored
View File

@@ -1820,8 +1820,7 @@ d3.behavior.zoom = function() {
}
function zoomended(dispatch) {
if (!--zooming) dispatch({type: "zoomend"});
center0 = null;
if (!--zooming) dispatch({type: "zoomend"}), center0 = null;
}
function mousedowned() {
@@ -1964,7 +1963,7 @@ d3.behavior.zoom = function() {
function mousewheeled() {
var dispatch = event.of(this, arguments);
if (mousewheelTimer) clearTimeout(mousewheelTimer);
else translate0 = location(center0 = center || d3.mouse(this)), d3_selection_interrupt.call(this), zoomstarted(dispatch);
else d3_selection_interrupt.call(this), translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch);
mousewheelTimer = setTimeout(function() { mousewheelTimer = null; zoomended(dispatch); }, 50);
d3_eventPreventDefault();
scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);