CanvasRenderingContext2D.miterLimit

Свойство CanvasRenderingContext2D.miterLimit устанавливает/возвращает максимальную длину среза.

Длина среза это расстояние между внутренним и внешнем углом, образованным пересечением двух линий.

Примечание: For more info about miters, see Applying styles and color in the Canvas tutorial.

Синтаксис

ctx.miterLimit = число;

Options

число

Положительное число, определяющее максимальную длину среза. Если текущая длина среза будет превышать заданное значение, то угол будет отображаться как при значении bevel свойства lineJoin.

Примеры

Using the miterLimit property

See the chapter Applying styles and color in the Canvas tutorial for more information.

ScreenshotLive sample

Спецификации

Specification
HTML Standard
# dom-context-2d-miterlimit-dev

Browser compatibility

BCD tables only load in the browser

  • In WebKit- and Blink-based Browsers, a non-standard and deprecated method ctx.setMiterLimit() is implemented in addition to this property.

Gecko-specific notes

  • Starting Gecko 2.0, setting miterLimit to a negative value no longer throws an exception; instead, it properly ignores non-positive values.

See also