diff options
author | vng <viktor.govako@gmail.com> | 2012-03-03 06:15:30 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:36:16 +0300 |
commit | e1d0b54c95932b7d6beb33ab09520a7dccb18f6e (patch) | |
tree | c592b3db46d8a8761c47393eee60d1c90c19923a /indexer | |
parent | 3f99bdedbd03ac1ce59e06011f8bdbd01951278d (diff) |
[search] Fix minor bug with search result viewport - select nearest acceptable scale.
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/feature_utils.cpp | 5 |
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; } } |