bufferReducedPrecision method

void bufferReducedPrecision()

Implementation

void bufferReducedPrecision() {
  // try and compute with decreasing precision
  for (int precDigits = MAX_PRECISION_DIGITS; precDigits >= 0; precDigits--) {
    try {
      bufferReducedPrecisionWithDigits(precDigits);
    } catch (ex) {
      // update the saved exception to reflect the new input geometry
      // saveException = ex as Exception;
      print(ex);
      // don't propagate the exception - it will be detected by fact that resultGeometry is null
    }
    if (resultGeometry != null) return;
  }

  // tried everything - have to bail
  throw StateError("bufferReducedPrecision error");
}