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>2013-09-14 19:03:40 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:01:37 +0300
commit0eac5695941220e100c910c56ac1ce3d147b0668 (patch)
tree6f1b466892b1056448158c7577cef6becf5f8b3e /indexer/scales.cpp
parent2b2be34748405f9c77851aec64c14987394f13ad (diff)
Return back INITIAL_LEVEL for scales - current styles are optimized for this increment.
Diffstat (limited to 'indexer/scales.cpp')
-rw-r--r--indexer/scales.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indexer/scales.cpp b/indexer/scales.cpp
index aa760442ca..a1db3730b7 100644
--- a/indexer/scales.cpp
+++ b/indexer/scales.cpp
@@ -8,10 +8,11 @@
namespace scales
{
+ static const int INITIAL_LEVEL = 1;
double GetScaleLevelD(double ratio)
{
- double const level = min(static_cast<double>(GetUpperScale()), log(ratio) / log(2.0));
+ double const level = min(static_cast<double>(GetUpperScale()), log(ratio) / log(2.0) + INITIAL_LEVEL);
return (level < 0.0 ? 0.0 : level);
}
@@ -37,7 +38,9 @@ namespace scales
double GetRationForLevel(double level)
{
- return max(0.0, pow(2.0, level));
+ if (level < INITIAL_LEVEL)
+ level = INITIAL_LEVEL;
+ return pow(2.0, level - INITIAL_LEVEL);
}
m2::RectD GetRectForLevel(double level, m2::PointD const & center)