summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mbgl/util/constants.hpp2
-rw-r--r--src/mbgl/annotation/shape_annotation_impl.cpp4
-rw-r--r--src/mbgl/map/transform_state.cpp6
3 files changed, 6 insertions, 6 deletions
diff --git a/include/mbgl/util/constants.hpp b/include/mbgl/util/constants.hpp
index 607c388e95..3c0b3eb93e 100644
--- a/include/mbgl/util/constants.hpp
+++ b/include/mbgl/util/constants.hpp
@@ -18,7 +18,7 @@ constexpr float tileSize = 512;
* In practice, all features are converted to this extent before being added.
*
* Positions are stored as signed 16bit integers.
- * One bit is lost for signedness to support featuers extending past the left edge of the tile.
+ * One bit is lost for signedness to support features extending past the left edge of the tile.
* One bit is lost because the line vertex buffer packs 1 bit of other data into the int.
* One bit is lost to support features extending past the extent on the right edge of the tile.
* This leaves us with 2^13 = 8192
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<geojsonvt::ProjectedFeature> features = {
ShapeAnnotationGeometry::visit(geometry(), ToGeoJSONVT(tolerance))
diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp
index fab5991de8..3d5a1a6798 100644
--- a/src/mbgl/map/transform_state.cpp
+++ b/src/mbgl/map/transform_state.cpp
@@ -16,13 +16,13 @@ TransformState::TransformState(ConstrainMode constrainMode_, ViewportMode viewpo
#pragma mark - Matrix
void TransformState::matrixFor(mat4& matrix, const UnwrappedTileID& tileID) const {
- const uint64_t tileScale = 1ull << tileID.canonical.z;
+ const uint32_t tileScale = 1u << tileID.canonical.z;
const double s = worldSize() / tileScale;
matrix::identity(matrix);
matrix::translate(matrix, matrix,
- static_cast<int64_t>(tileID.canonical.x + tileID.wrap * tileScale) * s,
- static_cast<int64_t>(tileID.canonical.y) * s, 0);
+ int64_t(tileID.canonical.x + tileID.wrap * tileScale) * s,
+ int64_t(tileID.canonical.y) * s, 0);
matrix::scale(matrix, matrix, s / util::EXTENT, s / util::EXTENT, 1);
}