mirror of https://github.com/luileito/jsketch.git
Normalize finger IDs
This commit is contained in:
parent
1e2c32d40d
commit
fb7758ec3d
|
|
@ -430,15 +430,16 @@
|
|||
var touches = e.originalEvent.changedTouches;
|
||||
for (var i = 0; i < touches.length; i++) {
|
||||
var touch = touches[i];
|
||||
// Add the type of event to the touch object.
|
||||
// Add event type and finger ID.
|
||||
touch.type = e.type;
|
||||
touch.identifier = i;
|
||||
callback(touch);
|
||||
}
|
||||
} else {
|
||||
// Track only the current finger.
|
||||
var touch = e.originalEvent.touches[0];
|
||||
// Add the type of event to the touch object.
|
||||
touch.type = e.type;
|
||||
touch.identifier = 0;
|
||||
callback(touch);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -439,15 +439,16 @@
|
|||
var touches = e.changedTouches;
|
||||
for (var i = 0; i < touches.length; i++) {
|
||||
var touch = touches[i];
|
||||
// Add the type of event to the touch object.
|
||||
// Add event type and finger ID.
|
||||
touch.type = e.type;
|
||||
touch.identifier = i;
|
||||
callback(touch);
|
||||
}
|
||||
} else {
|
||||
// Track only the current finger.
|
||||
var touch = e.touches[0];
|
||||
// Add the type of event to the touch object.
|
||||
touch.type = e.type;
|
||||
touch.identifier = 0;
|
||||
callback(touch);
|
||||
}
|
||||
e.preventDefault();
|
||||
|
|
|
|||
Loading…
Reference in New Issue