Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jtangelder committed Jul 25, 2014
1 parent b298dfa commit caa60b9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/input/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ inherit(TouchInput, Input, {
* @returns {Array} [all, changed]
*/
function normalizeTouches(ev, touchInput, type) {
var i, len;
var targetIds = touchInput.targetIds;
var allTouches = toArray(ev.touches);
var targetTouches = toArray(ev.targetTouches);
var changedTouches = toArray(ev.changedTouches);
var changedTargetTouches = [];

// when there is only one touch, the process can be simplified
if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
return [allTouches, allTouches];
}

var i, len;
var targetIds = touchInput.targetIds;
var targetTouches = toArray(ev.targetTouches);
var changedTouches = toArray(ev.changedTouches);
var changedTargetTouches = [];

// collect touches
if (type === INPUT_START) {
for (i = 0, len = targetTouches.length; i < len; i++) {
Expand Down

0 comments on commit caa60b9

Please sign in to comment.