{"action":"opened","issue":{"url":"https://api.github.com/repos/intridea/sketch.js/issues/45","repository_url":"https://api.github.com/repos/intridea/sketch.js","labels_url":"https://api.github.com/repos/intridea/sketch.js/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/intridea/sketch.js/issues/45/comments","events_url":"https://api.github.com/repos/intridea/sketch.js/issues/45/events","html_url":"https://github.com/intridea/sketch.js/issues/45","id":150393278,"number":45,"title":"Mobile Error on method onEvent (with correction)","user":{"login":"emitategh","id":8492754,"avatar_url":"https://avatars.githubusercontent.com/u/8492754?v=3","gravatar_id":"","url":"https://api.github.com/users/emitategh","html_url":"https://github.com/emitategh","followers_url":"https://api.github.com/users/emitategh/followers","following_url":"https://api.github.com/users/emitategh/following{/other_user}","gists_url":"https://api.github.com/users/emitategh/gists{/gist_id}","starred_url":"https://api.github.com/users/emitategh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emitategh/subscriptions","organizations_url":"https://api.github.com/users/emitategh/orgs","repos_url":"https://api.github.com/users/emitategh/repos","events_url":"https://api.github.com/users/emitategh/events{/privacy}","received_events_url":"https://api.github.com/users/emitategh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-22T15:00:11Z","updated_at":"2016-04-22T15:00:11Z","closed_at":null,"body":"Hi, I was getting an \"undefined getX\" or \"undefined getY\"\r\nBecouse e.originalEvent.targetTouches had length 0 on last touchevent\r\n \r\nSketch.prototype.onEvent = function(e) {\r\n      console.log(e.originalEvent.targetTouches);\r\n      if (e.originalEvent && e.originalEvent.targetTouches) {\r\n        if (e.originalEvent.targetTouches.length){ ///-----------> Added\r\n          e.pageX = e.originalEvent.targetTouches[0].pageX;\r\n          e.pageY = e.originalEvent.targetTouches[0].pageY;\r\n        }\r\n      }\r\n      $.sketch.tools[$(this).data('sketch').tool].onEvent.call($(this).data('sketch'), e);\r\n      e.preventDefault();\r\n      return false;\r\n    };"}}