File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -205,7 +205,8 @@ function (container, option) {
205
205
// 浏览器对changedTouches的实现存在问题, 因此总是使用全量的touches进行比对
206
206
function compareTouchFingers ( event ) {
207
207
var identSet = { } ;
208
- // 将不存在手指的添加到集合中
208
+
209
+ // 添加target内新出现的手指
209
210
for ( var i = 0 ; i < event . originalEvent . targetTouches . length ; ++ i ) {
210
211
var touch = event . originalEvent . targetTouches [ i ] ;
211
212
identSet [ touch . identifier ] = true ;
@@ -214,10 +215,10 @@ function (container, option) {
214
215
++ fingerCount ;
215
216
}
216
217
}
217
- // 将已删除的手指集合清理
218
+ // 将target内消失的手指移除
218
219
for ( var identifier in touchFingers ) {
219
- // 浏览器集合中已不存在,删除
220
- if ( identSet [ identifier ] === undefined ) {
220
+ // 与本次touchevent属于同一个target,但是touchevent中已消失的手指,需要移除
221
+ if ( identSet [ identifier ] === undefined && touchFingers [ identifier ] . target === event . originalEvent . target ) {
221
222
delete ( touchFingers [ identifier ] ) ;
222
223
-- fingerCount ;
223
224
}
You can’t perform that action at this time.
0 commit comments