Skip to content

Commit

Permalink
Correction of height and width in extracted canvas (#5842)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboksa authored and bigtimebuddy committed Sep 21, 2019
1 parent dbb56b7 commit 3bf4e47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/extract/canvas/CanvasExtract.js
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/extract/webgl/WebGLExtract.js
Expand Up @@ -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);

Expand Down

0 comments on commit 3bf4e47

Please sign in to comment.