Quantcast
Channel: HTML5 canvas context doesn't clear with clearRect() - Stack Overflow
Browsing index pages (2 articles)
↧

HTML5 canvas context doesn't clear with clearRect()

I have two canvases: a buffer and a display canvas whose context gets a drawImage() call with the buffer canvas. I clearRect() both canvases before adding new objects and calling drawImage(), but both...

View Article


Answer by dsgriffin for HTML5 canvas context doesn't clear with clearRect()

You've forgotten to begin a new path each time using .beginPath() (prevents the event stacking issue you're witnessing):bufCanvas.addEventListener('mousedown', function (e) { ctx.clearRect(0, 0, 500,...

View Article

Browsing index pages (2 articles)


Latest Images