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-02-09 01:23:06 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:33:53 +0300
commitfc21bc03b5efba5915686d82bf505653cfcfcb10 (patch)
tree8f861fe185c7a54c635b3b9ccbea7555a49e79ed
parentc7913216d250cbf8cb173ca98f97e7592e22283b (diff)
[search] Fix result viewport for features with no any texts.
-rw-r--r--indexer/feature_utils.cpp4
-rw-r--r--indexer/feature_visibility.hpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp
index 0302354f80..69d28a3394 100644
--- a/indexer/feature_utils.cpp
+++ b/indexer/feature_utils.cpp
@@ -80,6 +80,10 @@ public:
{
// get minimal draw text scale for feature type, that not mentioned in GetScaleForType
scale = feature::DrawableScaleRangeForText(types).first;
+
+ // if no texts at all - show at maximum zoom
+ if (scale == -1)
+ scale = upperScale;
}
return scales::GetRectForLevel(scale, center, 1.0);
diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp
index 70b8790b37..bd9b30984c 100644
--- a/indexer/feature_visibility.hpp
+++ b/indexer/feature_visibility.hpp
@@ -28,8 +28,12 @@ namespace feature
int MinDrawableScaleForFeature(FeatureBase const & f);
+ /// @name Get scale range when feature's text is visible.
+ /// @return [-1, -1] if no any text exists
+ //@{
pair<int, int> DrawableScaleRangeForText(TypesHolder const & types);
pair<int, int> DrawableScaleRangeForText(FeatureBase const & f);
+ //@}
/// @return (geometry type, is coastline)
pair<int, bool> GetDrawRule(FeatureBase const & f, int level,