diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 7b9811b..469514f 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -197,8 +197,8 @@ this.shader.uniforms.uFrame.value[2] = tempUvs.x1 - tempUvs.x0; this.shader.uniforms.uFrame.value[3] = tempUvs.y2 - tempUvs.y0; - this.shader.uniforms.uTransform.value[0] = (this.tilePosition.x % tw) / this._width; - this.shader.uniforms.uTransform.value[1] = (this.tilePosition.y % th) / this._height; + this.shader.uniforms.uTransform.value[0] = (this.tilePosition.x % tempWidth) / this._width; + this.shader.uniforms.uTransform.value[1] = (this.tilePosition.y % tempHeight) / this._height; this.shader.uniforms.uTransform.value[2] = ( tw / this._width ) * this.tileScale.x; this.shader.uniforms.uTransform.value[3] = ( th / this._height ) * this.tileScale.y; @@ -229,8 +229,8 @@ transform = this.worldTransform, resolution = renderer.resolution, baseTexture = texture.baseTexture, - modX = this.tilePosition.x % baseTexture.width, - modY = this.tilePosition.y % baseTexture.height; + modX = this.tilePosition.x % texture._frame.width, + modY = this.tilePosition.y % texture._frame.height; // create a nice shiny pattern! // TODO this needs to be refreshed if texture changes..