setPolygonOffset method

void setPolygonOffset(
  1. bool polygonOffset, [
  2. double? factor,
  3. double? units
])

Implementation

void setPolygonOffset(bool polygonOffset, [double? factor, double? units]) {
  if (polygonOffset) {
    enable(WebGL.POLYGON_OFFSET_FILL);

    if (currentPolygonOffsetFactor != factor || currentPolygonOffsetUnits != units) {
      gl.polygonOffset(factor!, units!);

      currentPolygonOffsetFactor = factor;
      currentPolygonOffsetUnits = units;
    }
  } else {
    disable(WebGL.POLYGON_OFFSET_FILL);
  }
}