Answer the question
In order to leave comments, you need to log in
How to center canvas in the middle?
How to center canvas in the middle?
const canvas = document.querySelector("#canvas"),
ctx = canvas.getContext("2d");
canvas.width = (window.innerWidth * 90) / 100;
canvas.height = (window.innerHeight * 90) / 100;
ctx.fillRect(0, 0, canvas.width, canvas.height);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question