I just get confused about canvas clear stuff -- the sketch has been cleared from canvas, but when I click the canvas to draw something new, the cleared sketch just come back at the same position again. It looks like the sketch has been saved to some "cookies", which has been reloaded when the next time clicking the canvas or mouse over the canvas.
clear.click(function()){
var canvas = document,getElementById('mycanvas');
var context = canvas.getContext('2d');
context.clearRect(0,0,width,height);
});
I use sketch.js for drawing: http://intridea.github.com/sketch.js/ Actually, the code in sketch.js did clean canvas too: canvas.width = canvas.width. Any idea about how to clear it thoroughly? thanks!