Commit 36b8a0b1 authored by Jason Davies's avatar Jason Davies
Browse files

Optimise.

This block is only necessary if there are remaining touches, because
otherwise the gesture has ended and we remove this closure along with
locations0.  Thanks, @mbostock!
parent abc9dbb0
......@@ -1407,11 +1407,11 @@ d3 = function() {
zoomed(event_);
}
function ended() {
var touches = d3.event.changedTouches;
for (var i = 0, n = touches.length; i < n; ++i) {
delete locations0[touches[i].identifier];
}
if (d3.event.touches.length) {
var touches = d3.event.changedTouches;
for (var i = 0, n = touches.length; i < n; ++i) {
delete locations0[touches[i].identifier];
}
relocate();
} else {
w.on(touchmove, null).on(touchend, null);
......
This diff is collapsed.
......@@ -261,11 +261,11 @@ d3.behavior.zoom = function() {
}
function ended() {
var touches = d3.event.changedTouches;
for (var i = 0, n = touches.length; i < n; ++i) {
delete locations0[touches[i].identifier];
}
if (d3.event.touches.length) {
var touches = d3.event.changedTouches;
for (var i = 0, n = touches.length; i < n; ++i) {
delete locations0[touches[i].identifier];
}
relocate(); // locations may have detached due to rotation
} else {
w.on(touchmove, null).on(touchend, null);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment