diff --git a/package.json b/package.json index 096ae2a..27fbfcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "4.3.0", + "version": "4.3.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ diff --git a/package.json b/package.json index 096ae2a..27fbfcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "4.3.0", + "version": "4.3.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 61245e8..aad715a 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -34,12 +34,17 @@ */ pushMask(target, maskData) { + // TODO the root check means scissor rect will not + // be used on render textures more info here: + // https://github.com/pixijs/pixi.js/pull/3545 + if (maskData.texture) { this.pushSpriteMask(target, maskData); } else if (this.enableScissor && !this.scissor + && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) { diff --git a/package.json b/package.json index 096ae2a..27fbfcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "4.3.0", + "version": "4.3.2", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ diff --git a/src/core/renderers/webgl/managers/MaskManager.js b/src/core/renderers/webgl/managers/MaskManager.js index 61245e8..aad715a 100644 --- a/src/core/renderers/webgl/managers/MaskManager.js +++ b/src/core/renderers/webgl/managers/MaskManager.js @@ -34,12 +34,17 @@ */ pushMask(target, maskData) { + // TODO the root check means scissor rect will not + // be used on render textures more info here: + // https://github.com/pixijs/pixi.js/pull/3545 + if (maskData.texture) { this.pushSpriteMask(target, maskData); } else if (this.enableScissor && !this.scissor + && this.renderer._activeRenderTarget.root && !this.renderer.stencilManager.stencilMaskStack.length && maskData.isFastRect()) { 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) {