Use the lineTo method to add a new point in the WeChat applet
lineTo
Definition
lineTo
method adds a new point and then creates a line from the last specified point to the target point.
Tip: Use the stroke()
method to draw lines
Parameters
Example
const ctx = wx.createCanvasContext('myCanvas') ctx.moveTo(10, 10) ctx.rect(10, 10, 100, 50) ctx.lineTo(110, 60) ctx.stroke() ctx.draw()