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:
authorvng <viktor.govako@gmail.com>2012-03-03 06:15:30 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:36:16 +0300
commite1d0b54c95932b7d6beb33ab09520a7dccb18f6e (patch)
treec592b3db46d8a8761c47393eee60d1c90c19923a /indexer/feature_utils.cpp
parent3f99bdedbd03ac1ce59e06011f8bdbd01951278d (diff)
[search] Fix minor bug with search result viewport - select nearest acceptable scale.
Diffstat (limited to 'indexer/feature_utils.cpp')
-rw-r--r--indexer/feature_utils.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp
index 31840b4625..e6ff1f6415 100644
--- a/indexer/feature_utils.cpp
+++ b/indexer/feature_utils.cpp
@@ -54,12 +54,15 @@ public:
void CorrectScaleForVisibility(TypesHolder const & types, int & scale) const
{
pair<int, int> const scaleR = feature::DrawableScaleRangeForText(types);
+ ASSERT_LESS_OR_EQUAL ( scaleR.first, scaleR.second, () );
// Result types can be without visible texts (matched by category).
if (scaleR.first != -1)
{
- if (scale < scaleR.first || scale > scaleR.second)
+ if (scale < scaleR.first)
scale = scaleR.first;
+ else if (scale > scaleR.second)
+ scale = scaleR.second;
}
}