HTML canvas lineJoin attribute
Example
Create a rounded corner when two lines meet:
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 »
Browser support





Internet Explorer 9, Firefox, Opera, Chrome and Safari support the lineJoin attribute.
**Note:** Internet Explorer 8 and earlier versions do not support
Definition and Usage
The lineJoin attribute sets or returns the type of corner created when two lines meet.
Note:The "miter" value is affected by the miterLimit attribute.
| Default value: | miter |
|---|---|
| JavaScript syntax: | context.lineJoin="bevel|round|miter"; |
Attribute values
| Value | Description |
|---|---|
| bevel | Creates a bevel. |
| round | Creates a rounded corner. |
| miter | Default. Creates a sharp corner (miter). |
HTML canvas Reference Manual