Skip to content

Touchend is unreliable in multitouch #37

@feiss

Description

@feiss

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); // <------ !!!
  }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions