Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Fix integer overflow for high maximum zoom levels
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoabinader committed Oct 23, 2015
1 parent 224e405 commit 46e2f13
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mbgl/annotation/shape_annotation_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 46e2f13

Please sign in to comment.