Answer the question
In order to leave comments, you need to log in
How to make clearRect round in JavaScript?
Hello, I have such canvas
and such js<canvas id="c1" width="450" height="450"></canvas>
var canvas = document.getElementById('c1');
var ctx = canvas.getContext('2d');
ctx.fillStyle = '#00bf54';
ctx.fillRect(0, 0, 450, 450);
canvas.onmousedown = function (event) {
canvas.onmousemove = function (event) {
var x = event.clientX;
var y = event.clientY;
ctx.clearRect(x+0, y+0, 45, 45);
}
canvas.onmouseup = function () {
canvas.onmousemove = null;
}
}
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