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