2020-03-30 canvas使用注意事项
2020-03-30 本文已影响0人
夜色001
1、画线段的时候,要加上benginPath、closePath,进行路径重置,否则后续可能会受到线条叠加影响,出现意想不到的问题。
drawLineSegment (ctx, x, y, x1, y1) {
ctx.beginPath()
ctx.moveTo(x, y)
ctx.lineTo(x1, y1)
ctx.closePath()
ctx.stroke()
},