Easy Tutorial
❮ Met Win Stop Jsref Max ❯

HTML Canvas lineCap Property

Canvas Object

Example

Draw a rounded ending line cap:

JavaScript:


Browser Support

Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the lineCap property.

Note: Internet Explorer 8 and earlier versions do not support the <canvas> element.


Definition and Usage

The lineCap property sets or returns the style of the end caps for a line.

Note: The "round" and "square" values make the line slightly longer.

Default value: butt
JavaScript syntax: context.lineCap="butt round square";
--- ---

Property Values

Value Description
butt Default. Adds a straight edge to each end of the line.
round Adds a rounded cap to each end of the line.
square Adds a square cap to each end of the line.

Canvas Object

❮ Met Win Stop Jsref Max ❯