Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Serdtsev <serdtcev@corp.mail.ru>2018-12-25 15:54:05 +0300
committermpimenov <mpimenov@users.noreply.github.com>2019-01-23 12:38:58 +0300
commit8fbb1cfe1c6233b7979bad2da94e16fe0b03e1ad (patch)
tree5255d26844da037b795779fd1fad52e2fd7dbacc /indexer
parent0d634b923aa9e3bee33453f18d6a3a9f15d03d93 (diff)
[indexer] Fix cell depth for spiral coverer
Diffstat (limited to 'indexer')
-rw-r--r--indexer/cell_coverer.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/indexer/cell_coverer.hpp b/indexer/cell_coverer.hpp
index 423035cf3d..972ba8312d 100644
--- a/indexer/cell_coverer.hpp
+++ b/indexer/cell_coverer.hpp
@@ -125,10 +125,11 @@ void CoverSpiral(m2::RectD rect, int maxDepth, std::vector<CellId> & result)
CHECK(rect.IsValid(), ());
auto centralCell = Converter::ToCellId(rect.Center().x, rect.Center().y);
- while (centralCell.Level() > maxDepth && centralCell.Level() > 0)
+ auto levelMax = maxDepth - 1;
+ while (levelMax < centralCell.Level() && centralCell.Level() > 0)
centralCell = centralCell.Parent();
- if (centralCell.Level() > maxDepth)
+ if (levelMax < centralCell.Level())
return;
result.push_back(centralCell);