Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touchend is unreliable in multitouch #37

Open
feiss opened this issue Feb 15, 2015 · 4 comments
Open

Touchend is unreliable in multitouch #37

feiss opened this issue Feb 15, 2015 · 4 comments

Comments

@feiss
Copy link

feiss commented Feb 15, 2015

Trying mobile multitouch support, I've notice this unpredictable behaviour. Sometimes touchend is called, sometimes is not, and sometimes is called in a wrong x,y. Test code below and try it on mobile.

The code in the docs (handling multitouch in render()) runs perfectly, but there's no easy way to know if a touch starts or ends.

Tested on iPad mini (ios 7.1.2) and Nexus7 (android 5.0.2). On the nexus, where the frame rate is lower, the effect is worse.

var app = playground({
  ready: function(){
    this.layer.clear('#000').strokeStyle('#f00');
  },
  touchstart: function(ev) {
      this.layer.fillStyle("#0f0").fillCircle(ev.x, ev.y, 5);
  },
  touchmove: function(ev) {
    this.layer.fillStyle("#fff").fillCircle(ev.x, ev.y, 2);
  },
  touchend: function(ev) {
      this.layer.strokeCircle(ev.x, ev.y, 20); // <------ !!!
  }
});
@feiss feiss changed the title touchend faulty in multitouch Touchend faulty in multitouch Feb 15, 2015
@feiss feiss changed the title Touchend faulty in multitouch Touchend is unreliable in multitouch Feb 15, 2015
@rezoner
Copy link
Owner

rezoner commented Feb 15, 2015

@feiss - I've fixed it and put your test case online: http://canvasquery.com/toucherror

Could you confirm it's gone?

@feiss
Copy link
Author

feiss commented Feb 15, 2015

fixed in iOS! 💃 👍 👍

in Android touchend is not called (no red circles)

ps: do you have a life? :P

@rezoner
Copy link
Owner

rezoner commented Feb 15, 2015

Will investigate android as soon as I find my nexus.

ps: Since I am crunching Jameson for PAX the answer is close to no :)

@feiss
Copy link
Author

feiss commented Feb 15, 2015

Stop worrying about opened issues then! go go go! 📢 📢

(thanks anyway :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants