Skip to content

Commit e4cbaf5

Browse files
committed
cube hidpi fix
1 parent be575fa commit e4cbaf5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Applications/Cube/cube.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ Graphics.prototype.resize = function (width, height) {
239239
const dpr = window.devicePixelRatio || 1;
240240
this.canvas.width = width * dpr;
241241
this.canvas.height = height * dpr;
242-
this.gl.viewport(0, 0, width, height);
242+
this.gl.viewport(0, 0, this.canvas.width, this.canvas.height);
243243
// ctx.scale(dpr, dpr);
244-
this.gl.scalef(dpr, dpr);
244+
if (this.gl.scale) this.gl.scale(dpr, dpr);
245245
};
246246

247247
// export { drawScene };

0 commit comments

Comments
 (0)