Name
CanvasRenderingContext2D.lineCap: specifies how the ends of lines are rendered
Synopsis
String lineCap
Description
The lineCap
property
specifies how lines should be terminated. It matters only when
drawing wide lines. Legal values for this property are listed in the
following table. The default value is âbuttâ.
Value |
Meaning |
âbuttâ |
This default value specifies that the line should have no cap. The end of the line is straight and is perpendicular to the direction of the line. The line is not extended beyond its endpoint. |
âroundâ |
This value specifies that lines should be capped with a semicircle whose diameter is equal to the width of the line and which extends beyond the end of the line by one half the width of the line. |
âsquareâ |
This value specifies that lines should be capped with a rectangle. This value is like âbuttâ, but the line is extended by half of its width. |
Bugs
Firefox 1.5 does not properly implement the âbuttâ cap style. Butt caps are rendered as if they were âsquareâ line caps.
See Also
CanvasRenderingContext2D.lineJoin
Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.