mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 01:17:43 +00:00
Extract pixel from correct location for a framebuffer
This commit is contained in:
parent
15d7b9c6ef
commit
dfba4ae817
1 changed files with 3 additions and 1 deletions
|
@ -41,7 +41,9 @@ var WebGLSnapshot = function (sourceCanvas, config)
|
|||
{
|
||||
var pixel = new Uint8Array(4);
|
||||
|
||||
gl.readPixels(x, bufferHeight - y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
|
||||
var destY = (isFramebuffer) ? y : bufferHeight - y;
|
||||
|
||||
gl.readPixels(x, destY, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
|
||||
|
||||
callback.call(null, new Color(pixel[0], pixel[1], pixel[2], pixel[3] / 255));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue