Falcon80 Logo
Line Join

The lineJoin attribute is relevant if you are drawing paths continuously. The attribute takes three values: round, bevel and miter.

lineJoin on canvas
The lineJoin applies only if you are drawing paths or figures like the rectangle and has no influence on text.

HTML Code
<html>
<head>
  <script type="application/javascript">
function init() {
var canvas = document.getElementById("canvas");
if (canvas.getContext)
{
var ctx = canvas.getContext("2d");

// Let's keep the lineWidth high so that the difference in lineJoin options is noticeable

ctx.lineWidth=10.0;
ctx.lineCap="round";

// Feel free to try the other options for lineJoin viz., round and bevel
ctx.lineJoin = "miter";

// Draw two line in such a way that one line starts where the other ends.
ctx.moveTo(150, 100);
ctx.lineTo(200, 40);
ctx.lineTo(250, 100);

ctx.stroke(); }
}
  </script>
</head>
<body onload="init();">
<canvas id="canvas" width="900" height="500"></canvas><br>
</body>
</html>

Try Code