Skip to content

Commit 675e83e

Browse files
committed
Fix inverted RenderTexture snapshot. Fix phaserjs#5445
1 parent b270833 commit 675e83e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/renderer/snapshot/WebGLSnapshot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ var WebGLSnapshot = function (sourceCanvas, config)
6565

6666
var data = imageData.data;
6767

68+
// var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4;
69+
6870
for (var py = 0; py < height; py++)
6971
{
7072
for (var px = 0; px < width; px++)
7173
{
7274
var sourceIndex = ((height - py - 1) * width + px) * 4;
73-
var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4;
75+
var destIndex = (py * width + px) * 4;
7476

7577
data[destIndex + 0] = pixels[sourceIndex + 0];
7678
data[destIndex + 1] = pixels[sourceIndex + 1];

0 commit comments

Comments
 (0)