diff --git a/bundles/pixi.js/pixi.js.d.ts b/bundles/pixi.js/pixi.js.d.ts index ea5e6c0..83c4075 100644 --- a/bundles/pixi.js/pixi.js.d.ts +++ b/bundles/pixi.js/pixi.js.d.ts @@ -3528,7 +3528,8 @@ defaultMaskStack: Array; defaultFilterStack: Array; renderTexture: RenderTexture | null; - destinationFrame: Rectangle; + readonly sourceFrame: Rectangle; + readonly destinationFrame: Rectangle; bind(renderTexture: RenderTexture, sourceFrame: Rectangle, destinationFrame: Rectangle): void; diff --git a/bundles/pixi.js/pixi.js.d.ts b/bundles/pixi.js/pixi.js.d.ts index ea5e6c0..83c4075 100644 --- a/bundles/pixi.js/pixi.js.d.ts +++ b/bundles/pixi.js/pixi.js.d.ts @@ -3528,7 +3528,8 @@ defaultMaskStack: Array; defaultFilterStack: Array; renderTexture: RenderTexture | null; - destinationFrame: Rectangle; + readonly sourceFrame: Rectangle; + readonly destinationFrame: Rectangle; bind(renderTexture: RenderTexture, sourceFrame: Rectangle, destinationFrame: Rectangle): void; diff --git a/packages/core/src/filters/FilterSystem.js b/packages/core/src/filters/FilterSystem.js index 788efd1..81dc329 100644 --- a/packages/core/src/filters/FilterSystem.js +++ b/packages/core/src/filters/FilterSystem.js @@ -199,12 +199,12 @@ state.target = target; - state.sourceFrame = target.filterArea || target.getBounds(true); + state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true)); state.sourceFrame.pad(padding); if (autoFit) { - state.sourceFrame.fit(this.renderer.renderTexture.destinationFrame); + state.sourceFrame.fit(this.renderer.renderTexture.sourceFrame); } // round to whole number based on resolution diff --git a/bundles/pixi.js/pixi.js.d.ts b/bundles/pixi.js/pixi.js.d.ts index ea5e6c0..83c4075 100644 --- a/bundles/pixi.js/pixi.js.d.ts +++ b/bundles/pixi.js/pixi.js.d.ts @@ -3528,7 +3528,8 @@ defaultMaskStack: Array; defaultFilterStack: Array; renderTexture: RenderTexture | null; - destinationFrame: Rectangle; + readonly sourceFrame: Rectangle; + readonly destinationFrame: Rectangle; bind(renderTexture: RenderTexture, sourceFrame: Rectangle, destinationFrame: Rectangle): void; diff --git a/packages/core/src/filters/FilterSystem.js b/packages/core/src/filters/FilterSystem.js index 788efd1..81dc329 100644 --- a/packages/core/src/filters/FilterSystem.js +++ b/packages/core/src/filters/FilterSystem.js @@ -199,12 +199,12 @@ state.target = target; - state.sourceFrame = target.filterArea || target.getBounds(true); + state.sourceFrame.copyFrom(target.filterArea || target.getBounds(true)); state.sourceFrame.pad(padding); if (autoFit) { - state.sourceFrame.fit(this.renderer.renderTexture.destinationFrame); + state.sourceFrame.fit(this.renderer.renderTexture.sourceFrame); } // round to whole number based on resolution diff --git a/packages/core/src/renderTexture/RenderTextureSystem.js b/packages/core/src/renderTexture/RenderTextureSystem.js index 46349b5..e3db1a6 100644 --- a/packages/core/src/renderTexture/RenderTextureSystem.js +++ b/packages/core/src/renderTexture/RenderTextureSystem.js @@ -48,6 +48,13 @@ this.renderTexture = null; /** + * Source frame + * @member {PIXI.Rectangle} + * @readonly + */ + this.sourceFrame = new Rectangle(); + + /** * Destination frame * @member {PIXI.Rectangle} * @readonly @@ -122,6 +129,8 @@ this.renderer.stencil.setMaskStack(this.defaultMaskStack); } + this.sourceFrame.copyFrom(sourceFrame); + this.destinationFrame.x = destinationFrame.x / resolution; this.destinationFrame.y = destinationFrame.y / resolution;