Skip to content

Commit f552615

Browse files
committed
Fixed RenderTexture in WebGL.
1 parent 9c588d9 commit f552615

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/pixi/display/Sprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession, matrix)
298298
// A quick check to see if this element has a mask or a filter.
299299
if (this._mask || this._filters)
300300
{
301-
var spriteBatch = renderSession.spriteBatch;
301+
var spriteBatch = renderSession.spriteBatch;
302302

303303
// push filter first as we need to ensure the stencil buffer is correct for any masking
304304
if (this._filters)

src/pixi/textures/RenderTexture.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,18 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, matrix, clear
208208
return;
209209
}
210210

211-
// Frame buffers come in upside down so we need to flip the matrix
212-
matrix.translate(0, this.projection.y * 2);
213-
matrix.scale(1, -1);
211+
// Let's create a nice matrix to apply to our display object.
212+
// Frame buffers come in upside down so we need to flip the matrix.
213+
var wt = displayObject.worldTransform;
214+
wt.identity();
215+
wt.translate(0, this.projection.y * 2);
216+
217+
if (matrix)
218+
{
219+
wt.append(matrix);
220+
}
221+
222+
wt.scale(1, -1);
214223

215224
// Time to update all the children of the displayObject with the new matrix.
216225
for (var i = 0; i < displayObject.children.length; i++)

0 commit comments

Comments
 (0)