Skip to content

Commit ce12fae

Browse files
committed
Ensure that touch{move,end} listeners are removed.
Previously, if there were globally-active touches remaining, a given zoom gesture was not ended even if locations0 was empty. This fixes the problem by checking to see if locations0 is empty. If so, the gesture is ended.
1 parent 85e738e commit ce12fae

3 files changed

Lines changed: 20 additions & 13 deletions

File tree

d3.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,13 +1412,14 @@ d3 = function() {
14121412
for (var i = 0, n = changed.length; i < n; ++i) {
14131413
delete locations0[changed[i].identifier];
14141414
}
1415-
relocate();
1416-
} else {
1417-
w.on(touchmove, null).on(touchend, null);
1418-
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
1419-
dragRestore();
1420-
zoomended(event_);
1415+
for (var identifier in locations0) {
1416+
return relocate();
1417+
}
14211418
}
1419+
w.on(touchmove, null).on(touchend, null);
1420+
t.on(mousedown, mousedowned).on(touchstart, touchstarted);
1421+
dragRestore();
1422+
zoomended(event_);
14221423
}
14231424
}
14241425
function mousewheeled() {

0 commit comments

Comments
 (0)