summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2016-12-14 11:39:33 -0800
committerGitHub <noreply@github.com>2016-12-14 11:39:33 -0800
commite88f90446490ba9ab2c3117c9e7e025f11a9e609 (patch)
tree174a284760d28fbccca3dbc89d7f0c2e9f3d9c3c
parentafd14cbfe5dea97c66e53da7ac2adaa16d969356 (diff)
downloadqtlocation-mapboxgl-e88f90446490ba9ab2c3117c9e7e025f11a9e609.tar.gz
[core] Port ensure a non-zero source tile cache size (#7438)
This ports https://github.com/mapbox/mapbox-gl-native/pull/7242/ commits/2d323211af54499d5c822b8e45d7415bf92112f0 to the iOS 3.4.0 release branch.
-rw-r--r--src/mbgl/style/source_impl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/style/source_impl.cpp b/src/mbgl/style/source_impl.cpp
index 7949f26d48..d0ae54092d 100644
--- a/src/mbgl/style/source_impl.cpp
+++ b/src/mbgl/style/source_impl.cpp
@@ -139,8 +139,8 @@ void Source::Impl::updateTiles(const UpdateParameters& parameters) {
if (type != SourceType::Annotations && cache.getSize() == 0) {
size_t conservativeCacheSize =
- ((float)parameters.transformState.getWidth() / util::tileSize) *
- ((float)parameters.transformState.getHeight() / util::tileSize) *
+ std::max((float)parameters.transformState.getWidth() / util::tileSize, 1.0f) *
+ std::max((float)parameters.transformState.getHeight() / util::tileSize, 1.0f) *
(parameters.transformState.getMaxZoom() - parameters.transformState.getMinZoom() + 1) *
0.5;
cache.setSize(conservativeCacheSize);