diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-12-12 13:18:03 -0800 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2016-12-13 14:19:30 -0500 |
commit | 6cc0dd01bdc59204af743e1d59eb38a76228e323 (patch) | |
tree | 444f2082dae12be4a4d093b7143b8ce1bf4670e7 | |
parent | 4f333a0d00ea95d62c781c268f56eb1ac475efb9 (diff) | |
download | qtlocation-mapboxgl-6cc0dd01bdc59204af743e1d59eb38a76228e323.tar.gz |
[core] Ensure a non-zero source tile cache size
Previously, for viewport sizes less than 512 pixels in either direction, the computed size was 0.
-rw-r--r-- | src/mbgl/style/source_impl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/style/source_impl.cpp b/src/mbgl/style/source_impl.cpp index 0fbd205949..74a195f155 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.getSize().width / util::tileSize) * - ((float)parameters.transformState.getSize().height / util::tileSize) * + std::max((float)parameters.transformState.getSize().width / util::tileSize, 1.0f) * + std::max((float)parameters.transformState.getSize().height / util::tileSize, 1.0f) * (parameters.transformState.getMaxZoom() - parameters.transformState.getMinZoom() + 1) * 0.5; cache.setSize(conservativeCacheSize); |