diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 95f2af4..f37f2f5 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -1065,10 +1065,15 @@ canvasRenderer = new CanvasRenderer(); } - tempMatrix.tx = -bounds.x; - tempMatrix.ty = -bounds.y; + this.transform.updateLocalTransform(); + this.transform.localTransform.copy(tempMatrix); - canvasRenderer.render(this, canvasBuffer, false, tempMatrix); + tempMatrix.invert(); + + tempMatrix.tx -= bounds.x; + tempMatrix.ty -= bounds.y; + + canvasRenderer.render(this, canvasBuffer, true, tempMatrix); const texture = Texture.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode); diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 95f2af4..f37f2f5 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -1065,10 +1065,15 @@ canvasRenderer = new CanvasRenderer(); } - tempMatrix.tx = -bounds.x; - tempMatrix.ty = -bounds.y; + this.transform.updateLocalTransform(); + this.transform.localTransform.copy(tempMatrix); - canvasRenderer.render(this, canvasBuffer, false, tempMatrix); + tempMatrix.invert(); + + tempMatrix.tx -= bounds.x; + tempMatrix.ty -= bounds.y; + + canvasRenderer.render(this, canvasBuffer, true, tempMatrix); const texture = Texture.fromCanvas(canvasBuffer.baseTexture._canvasRenderTarget.canvas, scaleMode); diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index ccce680..1bd2d5e 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -162,6 +162,9 @@ if (transform) { transform.copy(tempWt); + + // lets not forget to flag the parent transform as dirty... + this._tempDisplayObjectParent.transform._worldID = -1; } else { @@ -169,6 +172,7 @@ } displayObject.parent = this._tempDisplayObjectParent; + displayObject.updateTransform(); displayObject.parent = cacheParent; // displayObject.hitArea = //TODO add a temp hit area