setPolygonOffset method

dynamic setPolygonOffset(
  1. bool polygonOffset,
  2. num? factor,
  3. num? units
)

Implementation

setPolygonOffset(bool polygonOffset, num? factor, num? units) {
  if (polygonOffset) {
    enable(gl.POLYGON_OFFSET_FILL);

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

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