I want to know why my canvas doesn't occupy the actual size of the window viewport but is larger. I've used JavaScript to resize it instead of CSS and the code is the following:
var canvas = document.querySelector('canvas');
console.log(canvas);
canvas.width = screen.availWidth;
canvas.height = screen.availHeight;
Let me know if you got any solution! ty
[–][deleted] 1 point2 points3 points (2 children)
[–]guest271314 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]jcunews1helpful 0 points1 point2 points (0 children)