consider device pixel density
This commit is contained in:
parent
57b6851c8d
commit
2d7fb37165
|
@ -41,8 +41,9 @@ let smoothCameraDistance = 4;
|
||||||
let mouseDragging = false;
|
let mouseDragging = false;
|
||||||
|
|
||||||
function resizeCanvas() {
|
function resizeCanvas() {
|
||||||
cv.width = cv.parentElement.clientWidth;
|
const dpr = window.devicePixelRatio;
|
||||||
cv.height = cv.parentElement.clientHeight;
|
cv.width = cv.parentElement.clientWidth * dpr;
|
||||||
|
cv.height = cv.parentElement.clientHeight * dpr;
|
||||||
gl.viewport(0, 0, cv.width, cv.height);
|
gl.viewport(0, 0, cv.width, cv.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue