Commit 340b1675 authored by Jason Davies's avatar Jason Davies
Browse files

Remove locations on touchend.

This avoids a potential bug where a touch identifier might be reused in
another gesture, but could still be referenced in locations0, thus
causing problems for the old gesture on touchmove.
parent 4b3795e1
......@@ -1411,6 +1411,10 @@ 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) {
relocate();
} else {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -264,6 +264,10 @@ 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) {
relocate(); // locations may have detached due to rotation
} else {
......
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