# CanvasContext.rotate(number rotate)

with Promise style call: Not supported

Mini Program plugin: Support

Rotate the current axis clockwise from the origin. The rotation angles of multiple invocations stack up. The origin can be used translate Method modification.

# parameter

# number rotate

Angle of rotation in radians degrees * Math.PI/180degrees The range is 0-360

# sample code

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()