When I add normal objects or layers to the canvas (using jCanvas) I'm able to clear the canvas using the clearCanvas()
function.
But when I make my layers draggable the clearCanvas()
function does not seem to work. It does clear the canvas when I click the button, but as soon as the mouse hovers the canvas again the removed content gets added again. What am I doing wrong here?
$('canvas').drawArc({
fillStyle: 'black',
x: 100, y: 100,
radius: 50,
draggable: true, // uncomment this and Clear canvas works.
layer: true,
});
$('#clear').click(function(){
$('canvas').clearCanvas();
});