diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 66f562f..7a37abf 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 % tempWidth) / this._width; - this.shader.uniforms.uTransform.value[1] = (this.tilePosition.y % tempHeight) / this._height; + this.shader.uniforms.uTransform.value[0] = (this.tilePosition.x % (tempWidth * this.tileScale.x)) / this._width; + this.shader.uniforms.uTransform.value[1] = (this.tilePosition.y % (tempHeight * this.tileScale.y)) / 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 % texture._frame.width, - modY = this.tilePosition.y % texture._frame.height; + modX = this.tilePosition.x % (texture._frame.width * this.tileScale.x), + modY = this.tilePosition.y % (texture._frame.height * this.tileScale.y); // create a nice shiny pattern! // TODO this needs to be refreshed if texture changes..