Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Port ensure a non-zero source tile cache size
Browse files Browse the repository at this point in the history
This ports #7242
commits/2d323211af54499d5c822b8e45d7415bf92112f0 to the iOS 3.4.0
release branch.
  • Loading branch information
boundsj committed Dec 14, 2016
1 parent afd14cb commit 7efb428
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mbgl/style/source_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7efb428

Please sign in to comment.