Touchend is unreliable in multitouch
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 - I've fixed it and put your test case online: http://canvasquery.com/toucherror
Could you confirm it's gone?
fixed in iOS! :dancer: :+1: :+1:
in Android touchend is not called (no red circles)
ps: do you have a life? :P
Will investigate android as soon as I find my nexus.
ps: Since I am crunching Jameson for PAX the answer is close to no :)
Stop worrying about opened issues then! go go go! :loudspeaker: :loudspeaker:
(thanks anyway :)