diff --git a/src/core/sprites/Sprite.js b/src/core/sprites/Sprite.js index 63a24cb..36ea5bb 100644 --- a/src/core/sprites/Sprite.js +++ b/src/core/sprites/Sprite.js @@ -121,6 +121,9 @@ this._transformID = -1; this._textureID = -1; + this._transformTrimmedID = -1; + this._textureTrimmedID = -1; + /** * Plugin that is responsible for rendering this element. * Allows to customize the rendering process without overriding '_renderWebGL' & '_renderCanvas' methods. @@ -139,6 +142,7 @@ _onTextureUpdate() { this._textureID = -1; + this._textureTrimmedID = -1; // so if _width is 0 then width was not set.. if (this._width) @@ -160,6 +164,7 @@ _onAnchorUpdate() { this._transformID = -1; + this._transformTrimmedID = -1; } /** @@ -241,6 +246,13 @@ { this.vertexTrimmedData = new Float32Array(8); } + else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID) + { + return; + } + + this._transformTrimmedID = this.transform._worldID; + this._textureTrimmedID = this._texture._updateID; // lets do some special trim code! const texture = this._texture; @@ -564,6 +576,7 @@ this.cachedTint = 0xFFFFFF; this._textureID = -1; + this._textureTrimmedID = -1; if (value) {