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:
authorrachytski <siarhei.rachytski@gmail.com>2012-02-02 14:33:14 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:32:58 +0300
commit4ffe8bedafe09073df71b2ce4e8dbee3af2a32b5 (patch)
tree598979d0ee11811c4b67b57cf0da7deda4631bc9 /android/jni/com/mapswithme/platform/Platform.cpp
parent8f73623005f68f8b1a5c9350e938794c3756e362 (diff)
[android] hardcoding computation of preached area. see issue #562
Diffstat (limited to 'android/jni/com/mapswithme/platform/Platform.cpp')
-rw-r--r--android/jni/com/mapswithme/platform/Platform.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/android/jni/com/mapswithme/platform/Platform.cpp b/android/jni/com/mapswithme/platform/Platform.cpp
index 82c675b76d..a334583a08 100644
--- a/android/jni/com/mapswithme/platform/Platform.cpp
+++ b/android/jni/com/mapswithme/platform/Platform.cpp
@@ -20,6 +20,8 @@ public:
screenWidth = static_cast<int>(pow(2.0, ceil(log(double(screenWidth)) / log2)));
screenHeight = static_cast<int>(pow(2.0, ceil(log(double(screenHeight)) / log2)));
+ size_t screenSize = max(screenWidth, screenHeight);
+
m_tileSize = min(max(max(screenWidth, screenHeight) / 2, 128), 512);
int k = static_cast<int>((256.0 / m_tileSize) * (256.0 / m_tileSize));
@@ -28,8 +30,9 @@ public:
/// pure magic ;)
- double rotatedScreenCircleDiameter = sqrt(screenWidth * screenWidth + screenHeight * screenHeight);
+ double rotatedScreenCircleDiameter = sqrt(screenSize * screenSize + screenSize * screenSize);
int tilesOnOneSide = ceil(rotatedScreenCircleDiameter / (m_tileSize / 1.05 / 2));
+ tilesOnOneSide += 1;
int singleScreenTilesCount = tilesOnOneSide * tilesOnOneSide;
m_maxTilesCount = singleScreenTilesCount * 2;