diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index a6a22f0..29e5d64 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -58,6 +58,8 @@ this.onTouchEnd = this.onTouchEnd.bind(this); this.onTouchMove = this.onTouchMove.bind(this); this.last = 0; + + this.currentCursor = "inherit"; }; // constructor @@ -219,8 +221,8 @@ // loop through interactive objects! var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; + + // return; for (i = 0; i < length; i++) { @@ -243,7 +245,7 @@ // loks like there was a hit! if(item.__hit) { - if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor; + if(item.buttonMode) this.currentCursor = item.defaultCursor; if(!item.__isOver) { @@ -264,6 +266,12 @@ } // ---> } + + + if(this.currentCursor !== this.interactionDOMElement.style.cursor) + { + this.interactionDOMElement.style.cursor = this.currentCursor; + } }; /** @@ -342,7 +350,7 @@ { var length = this.interactiveItems.length; - this.interactionDOMElement.style.cursor = 'inherit'; + this.currentCursor = 'inherit'; for (var i = 0; i < length; i++) { diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js index a6a22f0..29e5d64 100644 --- a/src/pixi/InteractionManager.js +++ b/src/pixi/InteractionManager.js @@ -58,6 +58,8 @@ this.onTouchEnd = this.onTouchEnd.bind(this); this.onTouchMove = this.onTouchMove.bind(this); this.last = 0; + + this.currentCursor = "inherit"; }; // constructor @@ -219,8 +221,8 @@ // loop through interactive objects! var length = this.interactiveItems.length; - - this.interactionDOMElement.style.cursor = 'inherit'; + + // return; for (i = 0; i < length; i++) { @@ -243,7 +245,7 @@ // loks like there was a hit! if(item.__hit) { - if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor; + if(item.buttonMode) this.currentCursor = item.defaultCursor; if(!item.__isOver) { @@ -264,6 +266,12 @@ } // ---> } + + + if(this.currentCursor !== this.interactionDOMElement.style.cursor) + { + this.interactionDOMElement.style.cursor = this.currentCursor; + } }; /** @@ -342,7 +350,7 @@ { var length = this.interactiveItems.length; - this.interactionDOMElement.style.cursor = 'inherit'; + this.currentCursor = 'inherit'; for (var i = 0; i < length; i++) { diff --git a/src/pixi/extras/TilingSprite.js b/src/pixi/extras/TilingSprite.js index 440a6c0..86d3853 100644 --- a/src/pixi/extras/TilingSprite.js +++ b/src/pixi/extras/TilingSprite.js @@ -177,18 +177,20 @@ context.beginPath(); - var tilePosition = this.tilePosition; + var tilePositionX = this.tilePosition.x % this.tilingTexture.width; + var tilePositionY = this.tilePosition.y % this.tilingTexture.height; + var tileScale = this.tileScale; // console.log(tileScale.x) // offset context.scale(tileScale.x,tileScale.y); - context.translate(tilePosition.x, tilePosition.y); + context.translate(tilePositionX, tilePositionY); context.fillStyle = this.__tilePattern; - context.fillRect(-tilePosition.x,-tilePosition.y,this.width / tileScale.x, this.height / tileScale.y); + context.fillRect(-tilePositionX,-tilePositionY,this.width / tileScale.x, this.height / tileScale.y); context.scale(1/tileScale.x, 1/tileScale.y); - context.translate(-tilePosition.x, -tilePosition.y); + context.translate(-tilePositionX, -tilePositionY); context.closePath(); };