setLineWidth method

void setLineWidth(
  1. double width
)

Sets the width for lines drawn by drawLine and drawLines.

The width is clamped to the range supported by the WebGL implementation.

  • width: The desired line width in pixels.

Implementation

void setLineWidth(double width) {
  if (_renderState.lineWidth != width) {
    if (width < _lineWidthMin || width > _lineWidthMax) {
      warn("LineWidth of $width not supported, Allowed ranges goes from $_lineWidthMin to $_lineWidthMax");
    }

    _renderState.lineWidth = width.clamp(_lineWidthMin, _lineWidthMax);
    flush();
    gl.lineWidth(_renderState.lineWidth);
  }
}