Canvas miterLimit Property

Watch a demo of different values of the miterLimit property.

Or click a specific value to see the result:

miterLimit = 10;
miterLimit = 2;
your browser does not support the canvas tag
your browser does not support the canvas tag
const c = document.getElementById('myCanvas');
const ctx = c.getContext('2d');
ctx.lineWidth=10;  
ctx.lineJoin='miter';    
ctx.miterLimit=2;      
ctx.moveTo(20,20);
ctx.lineTo(50,30);
ctx.lineTo(20,40);
ctx.stroke();

Play more with the code in our Tryit yourself editor: Try it Yourself ❯