From fc21bc03b5efba5915686d82bf505653cfcfcb10 Mon Sep 17 00:00:00 2001 From: vng Date: Thu, 9 Feb 2012 00:23:06 +0300 Subject: [PATCH] [search] Fix result viewport for features with no any texts. --- indexer/feature_utils.cpp | 4 ++++ indexer/feature_visibility.hpp | 4 ++++ 2 files changed, 8 insertions(+) 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 DrawableScaleRangeForText(TypesHolder const & types); pair DrawableScaleRangeForText(FeatureBase const & f); + //@} /// @return (geometry type, is coastline) pair GetDrawRule(FeatureBase const & f, int level,