diff options
-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); |