So I have been wondering what is causing the overflow to happen when I mention height and width to be window.innerheight and window.innerwidth respectively.
Here's a snippet:
var canvas = document.querySelector('canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
}
canvas {
border: 1px solid;
}
<body>
<canvas id="canvas" width=""></canvas>
<script src="./canvas.js"></script>
</body>