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

WeChat small program API drawing setLineJoin (set line intersection style)


May 19, 2021 WeChat Mini Program Development Document


Table of contents


WeChat small program API drawing setLineJoin (set line intersection style) Drawing interfaces and methods


canvasContext.setLineJoin


Defined

Set the intersection style of the line.

Parameters

Parameters Type Range Description
lineJoin String 'bevel'、'round'、'miter' The end intersection style of the line

Example

const ctx = wx.createCanvasContext('myCanvas')
ctx.beginPath()
ctx.moveTo(10, 10)
ctx.lineTo(100, 50)
ctx.lineTo(10, 90)
ctx.stroke()

ctx.beginPath()
ctx.setLineJoin('bevel')
ctx.setLineWidth(10)
ctx.moveTo(50, 10)
ctx.lineTo(140, 50)
ctx.lineTo(50, 90)
ctx.stroke()

ctx.beginPath()
ctx.setLineJoin('round')
ctx.setLineWidth(10)
ctx.moveTo(90, 10)
ctx.lineTo(180, 50)
ctx.lineTo(90, 90)
ctx.stroke()

ctx.beginPath()
ctx.setLineJoin('miter')
ctx.setLineWidth(10)
ctx.moveTo(130, 10)
ctx.lineTo(220, 50)
ctx.lineTo(130, 90)
ctx.stroke()

ctx.draw()

WeChat small program API drawing setLineJoin (set line intersection style)

WeChat small program API drawing setLineJoin (set line intersection style) Drawing interfaces and methods