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!
This commit is contained in:
Jason Davies 2013-08-31 01:29:59 +01:00
Родитель abc9dbb07f
Коммит 36b8a0b1ff
3 изменённых файлов: 9 добавлений и 9 удалений

8
d3.js поставляемый
Просмотреть файл

@ -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);

2
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -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);