Do I have to have the content.beginPath() and content.closePath()?

前端 未结 2 1259
南笙
南笙 2021-01-04 00:31

Does the beginPath and the closePath have to be included for this line to draw or for all of the graphics. I have the new HTML 5 Canvas book but this I was not completely ce

2条回答
  •  别那么骄傲
    2021-01-04 01:16

    beginPath() clears the old path so you can define a new one.

    closePath() connects the first point with the last point and is not needed in your example. In any case it would have be used before stroking of filling to have an effect on the rasterized result.

提交回复
热议问题