[core] Fix integer overflow for high maximum zoom levels

This commit is contained in:
Bruno de Oliveira Abinader
2015-10-23 11:00:24 -07:00
parent 224e405976
commit 46e2f13e68

View File

@@ -96,10 +96,12 @@ std::unique_ptr<StyleLayer> ShapeAnnotationImpl::createFillLayer() {
}
void ShapeAnnotationImpl::updateTile(const TileID& tileID, AnnotationTile& tile) {
static const double baseTolerance = 3;
static const uint16_t extent = 4096;
if (!shapeTiler) {
const double baseTolerance = 3;
const uint16_t extent = 4096;
const double tolerance = baseTolerance / ((1 << maxZoom) * extent);
const uint64_t maxAmountOfTiles = 1 << maxZoom;
const double tolerance = baseTolerance / (maxAmountOfTiles * extent);
ProjectedGeometryContainer rings;
std::vector<LonLat> points;