pixelYToTileY method

int pixelYToTileY(
  1. double pixelY
)

Converts a pixel Y coordinate to the corresponding tile Y number.

pixelY The pixel Y coordinate to convert Returns the tile Y coordinate containing this pixel

Implementation

int pixelYToTileY(double pixelY) {
  assert(pixelY >= 0, "pixelY ($pixelY) should be >= 0");
  assert(pixelY <= _mapSize, "pixelY ($pixelY) should be <= mapSize ($_mapSize)");
  return max(min(pixelY / tileSize, scalefactor.scalefactor - 1), 0).floor();
}