Skip to content

Instantly share code, notes, and snippets.

@Rudloff
Created June 4, 2014 14:27
Show Gist options
  • Save Rudloff/cdc38001248b5f35551f to your computer and use it in GitHub Desktop.
Save Rudloff/cdc38001248b5f35551f to your computer and use it in GitHub Desktop.
diff --git a/js/sketch.js b/js/sketch.js
index 1f5c62f..7048e55 100644
--- a/js/sketch.js
+++ b/js/sketch.js
@@ -96,7 +96,7 @@ var __slice = Array.prototype.slice;
return this.redraw();
};
Sketch.prototype.onEvent = function(e) {
- if (e.originalEvent && e.originalEvent.targetTouches) {
+ if (e.originalEvent && e.originalEvent.targetTouches && e.originalEvent.targetTouches[0]) {
e.pageX = e.originalEvent.targetTouches[0].pageX;
e.pageY = e.originalEvent.targetTouches[0].pageY;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment