Skip to content

Commit

Permalink
Fix issue pixijs#2662 Added a touch counter instead of flag to ensure…
Browse files Browse the repository at this point in the history
… the correct touch count
  • Loading branch information
starakaj committed Nov 17, 2016
1 parent 1c0c078 commit cd96208
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/interaction/InteractionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,9 @@ export default class InteractionManager extends EventEmitter
if (hit)
{
displayObject._touchDown = true;
if(typeof displayObject._touchCount === "undefined")
displayObject._touchCount = 0;
displayObject._touchCount ++;
this.dispatchEvent(displayObject, 'touchstart', this.eventData);
}
}
Expand Down Expand Up @@ -1393,15 +1396,15 @@ export default class InteractionManager extends EventEmitter
{
this.dispatchEvent(displayObject, 'touchend', this.eventData);

if (displayObject._touchDown)
if (displayObject._touchCount > 0)
{
displayObject._touchDown = false;
displayObject._touchCount --;
this.dispatchEvent(displayObject, 'tap', this.eventData);
}
}
else if (displayObject._touchDown)
else if (displayObject._touchCount)
{
displayObject._touchDown = false;
displayObject._touchCount --;
this.dispatchEvent(displayObject, 'touchendoutside', this.eventData);
}
}
Expand Down

0 comments on commit cd96208

Please sign in to comment.