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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access