Skip to content

Commit

Permalink
when only one touch is on the screen the whole process can be simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
jtangelder committed Jul 25, 2014
1 parent 57b0cbe commit b298dfa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/input/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ inherit(TouchInput, Input, {
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];
}

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

0 comments on commit b298dfa

Please sign in to comment.