Name
CanvasRenderingContext2D.miterLimit: maximum-miter-length-to-line-width ratio
Synopsis
float miterLimit
Description
When wide lines are drawn with the lineJoin
property set to âmiterâ and two
lines meet at an acute angle, the resulting miter can be quite long.
When miters are too long, they become visually jarring. This
miterLimit
property places an
upper bound on the length of the miter. This property expresses a
ratio of the miter length to the line width. The default value is
10, which means that a miter should never be longer than 10 times
the line width. If a miter reaches this length, it is beveled off.
This property has no effect when lineJoin
is âroundâ or âbevelâ.
Bugs
Firefox 1.5 does not correctly implement this property. When a
mitered join exceeds the miterLimit
, the join is converted to a
rounded join instead.
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.