Skip to content

Commit 5c86110

Browse files
committed
use drawingBufferWidth, drawingBufferHeight
1 parent 743348d commit 5c86110

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/utils.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ export function getDrawingbufferInfo(gl) {
105105
export function computeDrawingbufferSize(gl, drawingBufferInfo) {
106106
// this will need to change for hi-color support
107107
const {samples, depthBits, contextAttributes} = drawingBufferInfo;
108-
const {width, height} = gl.canvas;
109-
const size = width * height * 4;
108+
const size = gl.drawingBufferWidth * gl.drawingBufferHeight * 4 || 0;
110109
const depth = contextAttributes.depth ? 1 : 0;
111110
const stencil = contextAttributes.stencil ? 1 : 0;
112111
const depthSize = Math.min(stencil + depthBits > 16 ? 4 : 2, 4);

0 commit comments

Comments
 (0)