diff --git a/indexer/feature_utils.cpp b/indexer/feature_utils.cpp index 84eb377eb6..baf2f58531 100644 --- a/indexer/feature_utils.cpp +++ b/indexer/feature_utils.cpp @@ -78,7 +78,7 @@ public: scale = min(scale, GetScaleForType(types[i])); CorrectScaleForVisibility(types, scale); - return scales::GetRectForLevel(scale, limitRect.Center(), 1.0); + return scales::GetRectForLevel(scale - 0.5, limitRect.Center(), 1.0); } uint8_t GetSearchRank(TypesHolder const & types, m2::PointD const & pt, uint32_t population) const diff --git a/indexer/scales.cpp b/indexer/scales.cpp index 0a28b97927..f4bb0dd661 100644 --- a/indexer/scales.cpp +++ b/indexer/scales.cpp @@ -50,13 +50,13 @@ namespace scales return my::rounds(GetScaleLevelD(r)); } - double GetRationForLevel(int level) + double GetRationForLevel(double level) { if (level < initial_level) level = initial_level; return pow(2.0, level - initial_level); } - m2::RectD GetRectForLevel(int level, m2::PointD const & center, double X2YRatio) + m2::RectD GetRectForLevel(double level, m2::PointD const & center, double X2YRatio) { double const dy = 2.0*GetRationForLevel(level) / (1.0 + X2YRatio); double const dx = X2YRatio * dy; diff --git a/indexer/scales.hpp b/indexer/scales.hpp index a6dade1ca3..b81c63a948 100644 --- a/indexer/scales.hpp +++ b/indexer/scales.hpp @@ -16,9 +16,9 @@ namespace scales int GetScaleLevel(m2::RectD const & r); /// @return such ration, that GetScaleLevel(ration) == level - double GetRationForLevel(int level); + double GetRationForLevel(double level); /// @return such rect, that GetScaleLevel(rect) == level - m2::RectD GetRectForLevel(int level, m2::PointD const & center, double X2YRatio); + m2::RectD GetRectForLevel(double level, m2::PointD const & center, double X2YRatio); double GetEpsilonForLevel(int level); double GetEpsilonForSimplify(int level);