diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index e4d16f8..6b3638e 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -84,6 +84,15 @@ this.interactionDOMElement = null; /** + * This property determins if mousemove and touchmove events are fired only when the cursror is over the object + * Setting to true will make things work more in line with how the DOM verison works. + * Setting to false can make things easier for things like dragging + * @member {HTMLElement} + * @private + */ + this.moveWhenInside = true; + + /** * Have events been attached to the dom element? * * @member {boolean} @@ -154,6 +163,7 @@ * @private */ this._tempPoint = new core.Point(); + /** * The current resolution @@ -575,8 +585,13 @@ */ InteractionManager.prototype.processMouseMove = function ( displayObject, hit ) { - this.dispatchEvent( displayObject, 'mousemove', this.eventData); this.processMouseOverOut(displayObject, hit); + + // only display on mouse over + if(!this.moveWhenInside || hit) + { + this.dispatchEvent( displayObject, 'mousemove', this.eventData); + } }; @@ -775,7 +790,7 @@ this.eventData.data = touchData; this.eventData.stopped = false; - this.processInteractive( touchData.global, this.renderer._lastObjectRendered, this.processTouchMove, true ); + this.processInteractive( touchData.global, this.renderer._lastObjectRendered, this.processTouchMove, this.moveWhenInside ); this.returnTouchData( touchData ); } @@ -790,8 +805,10 @@ */ InteractionManager.prototype.processTouchMove = function ( displayObject, hit ) { - hit = hit; - this.dispatchEvent( displayObject, 'touchmove', this.eventData); + if(!this.moveWhenInside || hit) + { + this.dispatchEvent( displayObject, 'touchmove', this.eventData); + } }; /**