From a7a6217aaabb9d74a75b24870f4af29662ac18f6 Mon Sep 17 00:00:00 2001 From: obiot Date: Mon, 30 Apr 2012 13:01:32 +0800 Subject: [PATCH] also save the unique finger identifier --- src/input/input.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/input/input.js b/src/input/input.js index d3f31334ae..2da7c97a2f 100644 --- a/src/input/input.js +++ b/src/input/input.js @@ -175,30 +175,30 @@ * @private */ function updateCoordFromEvent(e) { - var x, y; - + // reset the touch array cache obj.touches.length=0; // non touch event (mouse) if (!e.touches) { - x = e.pageX - obj.mouse.offset.x; - y = e.pageY - obj.mouse.offset.y; + var x = e.pageX - obj.mouse.offset.x; + var y = e.pageY - obj.mouse.offset.y; if (me.sys.scale != 1.0) { x/=me.sys.scale; y/=me.sys.scale; } - obj.touches.push({ x: x, y: y }); + obj.touches.push({ x: x, y: y, id: 0}); } // touch event else { - for(var t=0, l=e.changedTouches.length; t * x : x position of the touch event in the canvas
* y : y position of the touch event in the canvas
+ * id : unique finger identifier
* @public * @type {Array} * @name me.input#touches