Window.onload =function() { varCanvas = document.getElementById ("Canvas"), Context= Canvas.getcontext ("2d"), Width= Canvas.width = 600, Height= Canvas.height = 600; Context.linecap= "Round"; Context.linejoin= "Miter"; Context.miterlimit= 1; Context.linewidth= 20; Context.strokestyle= "#999999"; Draw (); Context.linewidth= 1; Context.strokestyle= "#ff0000"; Draw (); functionDraw () {Context.beginpath (); Context.moveto (50, 50); Context.lineto (150, 50); Context.stroke (); Context.beginpath (); Context.rect (200, 200, 100, 100); Context.stroke (); Context.beginpath (); Context.moveto (390, 500); Context.lineto (400, 400); Context.lineto (410, 500); Context.stroke (); }};
If Set miterlimit = 100:
Linecap:http://www.w3schools.com/tags/canvas_linecap.asp
Linejoin:http://www.w3schools.com/tags/canvas_linejoin.asp
Miterlimit:http://www.w3schools.com/tags/canvas_miterlimit.asp
Https://egghead.io/lessons/javascript-drawing-styles-on-html5-canvas
[Javascript] Drawing Styles on HTML5 Canvas