When you draw too fast on a canvas then you will see gaps, see my working example here.
My code is:
let canvas = document.getElementById('drawing-canvas');
function drawingPen(e) {
const canvasSizes = canvas.width / cellSize;
canvasCtx.fillStyle = '#000000';
const currentX = Math.floor(e.offsetX / canvasSizes) * canvasSizes;
const currentY = Math.floor(e.offsetY / canvasSizes) * canvasSizes;
What am I doing wrong, why does the above code result to so many gaps when drawing fast?