Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/RenderWebGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ class RenderWebGL extends EventEmitter {
gl.disable(gl.STENCIL_TEST);
}

const pixels = new Uint8Array(bounds.width * bounds.height * 4);
const pixels = new Uint8Array(Math.floor(bounds.width * bounds.height * 4));
gl.readPixels(0, 0, bounds.width, bounds.height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);

if (this._debugCanvas) {
Expand Down Expand Up @@ -490,7 +490,7 @@ class RenderWebGL extends EventEmitter {
gl.disable(gl.STENCIL_TEST);
}

const pixels = new Uint8Array(bounds.width * bounds.height * 4);
const pixels = new Uint8Array(Math.floor(bounds.width * bounds.height * 4));
gl.readPixels(0, 0, bounds.width, bounds.height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);

if (this._debugCanvas) {
Expand Down Expand Up @@ -567,7 +567,7 @@ class RenderWebGL extends EventEmitter {

this._drawThese(candidateIDs, ShaderManager.DRAW_MODE.silhouette, projection);

const pixels = new Uint8Array(touchWidth * touchHeight * 4);
const pixels = new Uint8Array(Math.floor(touchWidth * touchHeight * 4));
gl.readPixels(0, 0, touchWidth, touchHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);

if (this._debugCanvas) {
Expand Down Expand Up @@ -648,7 +648,7 @@ class RenderWebGL extends EventEmitter {
gl.enable(gl.BLEND);
}

const data = new Uint8Array(bounds.width * bounds.height * 4);
const data = new Uint8Array(Math.floor(bounds.width * bounds.height * 4));
gl.readPixels(0, 0, bounds.width, bounds.height, gl.RGBA, gl.UNSIGNED_BYTE, data);

if (this._debugCanvas) {
Expand Down Expand Up @@ -865,7 +865,7 @@ class RenderWebGL extends EventEmitter {
gl.enable(gl.BLEND);
}

const stampPixels = new Uint8Array(bounds.width * bounds.height * 4);
const stampPixels = new Uint8Array(Math.floor(bounds.width * bounds.height * 4));
gl.readPixels(0, 0, bounds.width, bounds.height, gl.RGBA, gl.UNSIGNED_BYTE, stampPixels);

const stampCanvas = this._tempCanvas;
Expand Down Expand Up @@ -1041,7 +1041,7 @@ class RenderWebGL extends EventEmitter {
{extraUniforms: {u_modelMatrix: modelMatrix}}
);

const pixels = new Uint8Array(width * height * 4);
const pixels = new Uint8Array(Math.floor(width * height * 4));
gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);

// Known boundary points on left/right edges of pixels.
Expand Down