Skip to content

Commit 13180b9

Browse files
committed
If you had a Graphics object in the display list immediately after an object with a Bitmap Mask it would throw an error Uncaught TypeError: Cannot set property 'TL' of undefined. Fix phaserjs#4581
1 parent 9e5527f commit 13180b9

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ The following changes took place in the Pointer class:
141141
* `Tilemap.createDynamicLayer` would fail if you called it without setting the `x` and `y` arguments, even though they were flagged as being optional. Fix #4508 (thanks @jackfreak)
142142
* `RenderTexture.draw` didn't work if no `x` and `y` arguments were provided, even though they are optional, due to a problem with the way the frame cut values were added. The class has been refactored to prevent this, fixing issues like `RenderTexture.erase` not working with Groups. Fix #4528 (thanks @jbgomez21 @telinc1)
143143
* The `Grid` Game Object wouldn't render in Canvas mode at all. Fix #4585 (thanks @fyyyyy)
144+
* If you had a `Graphics` object in the display list immediately after an object with a Bitmap Mask it would throw an error `Uncaught TypeError: Cannot set property 'TL' of undefined`. Fix #4581 (thanks @Petah)
144145

145146
### Examples, Documentation and TypeScript
146147

src/gameobjects/graphics/GraphicsWebGLRenderer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca
4747
return;
4848
}
4949

50-
var pipeline = renderer.currentPipeline;
50+
var pipeline = this.pipeline;
51+
52+
renderer.setPipeline(pipeline, src);
5153

5254
var camMatrix = src._tempMatrix1;
5355
var graphicsMatrix = src._tempMatrix2;
5456
var currentMatrix = src._tempMatrix3;
5557

56-
renderer.setPipeline(pipeline);
57-
5858
currentMatrix.loadIdentity();
5959

6060
graphicsMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);

0 commit comments

Comments
 (0)