To add a cap to an HTML5 Canvas line, we can use the lineCap property. Lines can have one of three cap styles: butt, round, or square. Unless otherwise specified, HTML5 Canvas lines are defaulted with the butt cap style. The lineCap property must be set before calling stroke().
Code Editor
Modified on April 8th, 2013
by Eric Rowell