From 504e911226327335cdad494f59a7811a65cc453a Mon Sep 17 00:00:00 2001 From: Jurre Antoinsse Date: Tue, 20 May 2014 09:16:40 +0200 Subject: [PATCH 1/2] Disable multitouch by only starting a new stroke if there is one finger on screen --- src/signature_pad.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/signature_pad.js b/src/signature_pad.js index 08a3c40e..20ac8e95 100644 --- a/src/signature_pad.js +++ b/src/signature_pad.js @@ -118,8 +118,10 @@ var SignaturePad = (function (document) { this._canvas.style.msTouchAction = 'none'; this._canvas.addEventListener("touchstart", function (event) { - var touch = event.changedTouches[0]; - self._strokeBegin(touch); + if (event.targetTouches.length == 1) { + var touch = event.changedTouches[0]; + self._strokeBegin(touch); + } }); this._canvas.addEventListener("touchmove", function (event) { From 32c42690c6c6c1da1fa794f880eb9a90fe65eecd Mon Sep 17 00:00:00 2001 From: Jurre Antoinsse Date: Tue, 20 May 2014 09:17:48 +0200 Subject: [PATCH 2/2] Disable multitouch by using the current touchpoint --- src/signature_pad.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/signature_pad.js b/src/signature_pad.js index 20ac8e95..cb32b4d7 100644 --- a/src/signature_pad.js +++ b/src/signature_pad.js @@ -127,8 +127,7 @@ var SignaturePad = (function (document) { this._canvas.addEventListener("touchmove", function (event) { // Prevent scrolling. event.preventDefault(); - - var touch = event.changedTouches[0]; + var touch = event.targetTouches[0]; self._strokeUpdate(touch); });