WeChat applet API drawing rotates the coordinate axis clockwise
rotate
Definition
Centered on the origin, which can be modified using the translate method. Rotate the current coordinate axis clockwise. If rotate
is called multiple times, the rotation angles will be superimposed.
Parameters
const ctx = wx.createCanvasContext('myCanvas') ctx.strokeRect(100, 10, 150, 100) ctx.rotate(20 * Math.PI / 180) ctx.strokeRect(100, 10, 150, 100) ctx.rotate(20 * Math.PI / 180) ctx.strokeRect(100, 10, 150, 100) ctx.draw()