getPageFromPixels method

int getPageFromPixels(
  1. double pixels,
  2. double extent
)

Implementation

int getPageFromPixels(double pixels, double extent) {
  final double actual = math.max(0.0, pixels) / math.max(1.0, extent);
  final int round = _nearestStopForExtent(actual);
  //final double round = actual.roundToDouble();
  if ((actual - round).abs() < precisionErrorTolerance) {
    return round;
  }
  return round;
}