Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat widgets use moveto to move paths to specified points in the canvas without creating lines


May 19, 2021 WeChat Mini Program Development Document


Table of contents


WeChat widgets use moveto to move paths to specified points in the canvas without creating lines Drawing interfaces and methods

canvasContext.moveTo


Defined

Move the path to a specified point in the canvas without creating lines.

Tip: Draw stroke() method

Parameters

Parameters Type Description
Number The x coordinates of the target location
Y Number The y coordinates of the target location

Example

const ctx = wx.createCanvasContext('myCanvas')
ctx.moveTo(10, 10)
ctx.lineTo(100, 10)

ctx.moveTo(10, 50)
ctx.lineTo(100, 50)
ctx.stroke()
ctx.draw()

WeChat widgets use moveto to move paths to specified points in the canvas without creating lines

WeChat widgets use moveto to move paths to specified points in the canvas without creating lines Drawing interfaces and methods