diff --git a/src/extract/canvas/CanvasExtract.js b/src/extract/canvas/CanvasExtract.js index 941e534166..5f679936c8 100644 --- a/src/extract/canvas/CanvasExtract.js +++ b/src/extract/canvas/CanvasExtract.js @@ -99,8 +99,8 @@ export default class CanvasExtract frame.height = this.renderer.height; } - const width = frame.width * resolution; - const height = frame.height * resolution; + const width = Math.floor((frame.width * resolution) + 1e-4); + const height = Math.floor((frame.height * resolution) + 1e-4); const canvasBuffer = new core.CanvasRenderTarget(width, height, 1); const canvasData = context.getImageData(frame.x * resolution, frame.y * resolution, width, height); diff --git a/src/extract/webgl/WebGLExtract.js b/src/extract/webgl/WebGLExtract.js index 008aab3c12..70d12ececc 100644 --- a/src/extract/webgl/WebGLExtract.js +++ b/src/extract/webgl/WebGLExtract.js @@ -106,8 +106,8 @@ export default class WebGLExtract frame.height = textureBuffer.size.height; } - const width = frame.width * resolution; - const height = frame.height * resolution; + const width = Math.floor((frame.width * resolution) + 1e-4); + const height = Math.floor((frame.height * resolution) + 1e-4); const canvasBuffer = new core.CanvasRenderTarget(width, height, 1);