diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index a98e203..1b57de7 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -131,7 +131,7 @@ target.view.addEventListener('mousemove', this.onMouseMove.bind(this), true); target.view.addEventListener('mousedown', this.onMouseDown.bind(this), true); document.body.addEventListener('mouseup', this.onMouseUp.bind(this), true); - target.view.addEventListener('mouseout', this.onMouseUp.bind(this), true); + target.view.addEventListener('mouseout', this.onMouseOut.bind(this), true); // aint no multi touch just yet! target.view.addEventListener("touchstart", this.onTouchStart.bind(this), true); @@ -187,7 +187,6 @@ var item = this.interactiveItems[i]; - //if(!item.visible)continue; // OPTIMISATION - only calculate every time if the mousemove function exists.. @@ -307,6 +306,26 @@ } } + +PIXI.InteractionManager.prototype.onMouseOut = function(event) +{ + var length = this.interactiveItems.length; + + this.target.view.style.cursor = "default"; + + for (var i = 0; i < length; i++) + { + var item = this.interactiveItems[i]; + + if(item.__isOver) + { + this.mouse.target = item; + if(item.mouseout)item.mouseout(this.mouse); + item.__isOver = false; + } + } +} + /** * Is called when the mouse button is released on the renderer element *