Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# `StrokeState`

A `StrokeState` object is used to define stroke styles.

new StrokeState()

  Constructor method.

  Create a new empty stroke state object.

  Returns:

    `StrokeState`.

  EXAMPLE

      var strokeState = new mupdf.StrokeState();

Instance methods

setLineCap(style)
  Arguments:

    - style – `String` One of “Butt”, “Round” or “Square”.

  EXAMPLE

      strokeState.setLineCap("Butt");

getLineCap()
  Returns:

    `String` One of “Butt”, “Round” or “Square”.

  EXAMPLE

      var lineCap = strokeState.getLineCap();

setLineJoin(style)
  Arguments:

    - style – `String` One of “Miter”, “Round” or “Bevel”.

  EXAMPLE

      strokeState.setLineJoin("Butt");

getLineJoin()
  Returns:

    `String` One of “Miter”, “Round” or “Bevel”.

  EXAMPLE

      var lineJoin = strokeState.getLineJoin();

setLineWidth(width)
  Arguments:

    - width – `Integer`.

  EXAMPLE

      strokeState.setLineWidth(2);

getLineWidth()
  Returns:

    `Integer`.

  EXAMPLE

      var width = strokeState.getLineWidth();

setMiterLimit(width)
  Arguments:

    - width – `Integer`.

  EXAMPLE

      strokeState.setMiterLimit(2);

getMiterLimit()
  Returns:

    `Integer`.

  EXAMPLE

      var limit = strokeState.getMiterLimit();