HTML canvas lineJoin attribute

Definition and Usage

lineJoin The property sets or returns the type of corner created when two lines intersect.

Note:The value "miter" is affected by miterLimit The influence of properties.

Example

When two lines intersect, create circular corners:

Your browser does not support the canvas tag.

JavaScript:

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.lineJoin="round";
ctx.moveTo(20,20);
ctx.lineTo(100,50);
ctx.lineTo(20,100);
ctx.stroke();

Try It Yourself

Syntax

context.lineJoin="bevel|round|miter";

Attribute Value

Value Description
bevel Create bevel corners.
round Create rounded corners.
miter Default. Create sharp corners.

Technical Details

Default Value: miter

Browser Support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
4.0 9.0 3.6 4.0 10.1

Note:Internet Explorer 8 and earlier versions do not support the <canvas> element.