setting canvas width or height should clear the canvas

setting canvas width or height should clear the canvas