HTML canvas lineJoin attribute
Definition and usage
lineJoin
Property settings or returns the type of corner created when two lines intersect.
注記:The value "miter" is affected by miterLimit The influence of properties.
Instance
When two lines intersect, create a circular corner:
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();
文法
context.lineJoin="bevel|round|miter";
属性値
値 | 説明 |
---|---|
bevel | 斜角を生成します。 |
round | 円角を生成します。 |
miter | デフォルト。尖角を生成します。 |
技術的詳細
デフォルト値: | miter |
---|
ブラウザのサポート
表の数字は、その属性を完全にサポートする最初のブラウザのバージョンを示しています。
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
4.0 | 9.0 | 3.6 | 4.0 | 10.1 |
注記:Internet Explorer 8 以降のバージョンでは <canvas> 要素がサポートされていません。