diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index 8153beb..5dedb4c 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -571,14 +571,12 @@ touchData.global.x = touchEvent.clientX; touchData.global.y = touchEvent.clientY; } - } - var length = this.interactiveItems.length; - for (i = 0; i < length; i++) - { - var item = this.interactiveItems[i]; - if(item.touchmove) - item.touchmove(touchData); + for (var j = 0; j < this.interactiveItems.length; j++) + { + var item = this.interactiveItems[j]; + if(item.touchmove && item.__touchData[touchEvent.identifier]) item.touchmove(touchData); + } } }; @@ -628,7 +626,8 @@ //call the function! if(item.touchstart)item.touchstart(touchData); item.__isDown = true; - item.__touchData = touchData; + item.__touchData = item.__touchData || {}; + item.__touchData[touchEvent.identifier] = touchData; if(!item.interactiveChildren)break; } @@ -666,11 +665,11 @@ for (var j = 0; j < length; j++) { var item = this.interactiveItems[j]; - var itemTouchData = item.__touchData; // <-- Here! - item.__hit = this.hitTest(item, touchData); - if(itemTouchData === touchData) - { + if(item.__touchData && item.__touchData[touchEvent.identifier]) { + + item.__hit = this.hitTest(item, item.__touchData[touchEvent.identifier]); + // so this one WAS down... touchData.originalEvent = event || window.event; // hitTest?? @@ -698,15 +697,8 @@ item.__isDown = false; } - item.__touchData = null; - + item.__touchData[touchEvent.identifier] = null; } - /* - else - { - - } - */ } // remove the touch.. this.pool.push(touchData);