From 1d46e83e3087f0d392c74c40d6b562359ed91576 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 28 Jun 2016 10:23:48 +0300 Subject: [core] Use the right types for zoom scale logic 32 bit integers should be enough for zoom scale logic. In shape annotation logic, 'maxAmountOfTileFeatures' requires 64 bits because we are multiplying the zoom scale with the extent, which might give a number higher than std::numeric_limits::max(). --- src/mbgl/annotation/shape_annotation_impl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mbgl/annotation/shape_annotation_impl.cpp') diff --git a/src/mbgl/annotation/shape_annotation_impl.cpp b/src/mbgl/annotation/shape_annotation_impl.cpp index a61611cf18..f22debdd81 100644 --- a/src/mbgl/annotation/shape_annotation_impl.cpp +++ b/src/mbgl/annotation/shape_annotation_impl.cpp @@ -90,8 +90,8 @@ void ShapeAnnotationImpl::updateTileData(const CanonicalTileID& tileID, Annotati static const double baseTolerance = 4; if (!shapeTiler) { - const uint64_t maxAmountOfTiles = 1 << maxZoom; - const double tolerance = baseTolerance / (maxAmountOfTiles * util::EXTENT); + const uint64_t maxAmountOfTileFeatures = (1ull << maxZoom) * util::EXTENT; + const double tolerance = baseTolerance / maxAmountOfTileFeatures; std::vector features = { ShapeAnnotationGeometry::visit(geometry(), ToGeoJSONVT(tolerance)) -- cgit v1.2.1