# CanvasContext.translate(number x, number and)

with Promise style call: Not supported

Mini Program plugin: Support

For the origin of the current coordinate system (0, 0) Transform. The default coordinate origin is the upper-left corner of the page.

# parameter

# number x

Horizontal coordinate translation quantity

# number and

Vertical coordinate translation

# sample code

const ctx = wx.createCanvasContext('myCanvas')

ctx.strokeRect(10, 10, 150, 100)
ctx.translate(20, 20)
ctx.strokeRect(10, 10, 150, 100)
ctx.translate(20, 20)
ctx.strokeRect(10, 10, 150, 100)

ctx.draw()