Erasing previously drawn lines on an HTML5 canvas

后端 未结 5 1682
臣服心动
臣服心动 2020-12-03 07:36

To play around with HTML5 canvas, I decided to make an app which draws an analogue clockface. Everything\'s fine, except that old lines don\'t get erased in the way that I w

5条回答
  •  猫巷女王i
    2020-12-03 08:02

    A quick and easy way to clear a canvas is to set the width:

    context.canvas.width = context.canvas.width;
    

提交回复
热议问题