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:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2015-12-04 17:38:15 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2015-12-29 16:36:13 +0300
commit004d14a026fc064d094cb2e0eef184ea9e08232b (patch)
treeed374ef3a49bc125bfc03cf5963e311b5499cebb
parent061580b1b26f297a84de09c9b5fd2e625d955ec5 (diff)
Preferred zoom levels and visual parameters changed.
-rw-r--r--drape/overlay_tree.cpp5
-rw-r--r--drape/overlay_tree.hpp2
-rw-r--r--drape_frontend/arrow3d.cpp2
-rwxr-xr-xdrape_frontend/frontend_renderer.cpp6
-rw-r--r--drape_frontend/my_position_controller.cpp5
-rw-r--r--drape_frontend/my_position_controller.hpp1
-rw-r--r--drape_frontend/user_event_stream.cpp6
-rw-r--r--indexer/scales.hpp4
-rw-r--r--map/framework.cpp2
9 files changed, 21 insertions, 12 deletions
diff --git a/drape/overlay_tree.cpp b/drape/overlay_tree.cpp
index 17c2f1c7f6..388db5df94 100644
--- a/drape/overlay_tree.cpp
+++ b/drape/overlay_tree.cpp
@@ -7,6 +7,7 @@ namespace dp
{
int const kFrameUpdarePeriod = 10;
+int const kFrameUpdarePeriodIn3d = 30;
int const kAverageHandlesCount[dp::OverlayRanksCount] = { 300, 200, 100 };
using TOverlayContainer = buffer_vector<detail::OverlayInfo, 8>;
@@ -54,13 +55,13 @@ OverlayTree::OverlayTree()
m_handles[i].reserve(kAverageHandlesCount[i]);
}
-bool OverlayTree::Frame()
+bool OverlayTree::Frame(bool is3d)
{
if (IsNeedUpdate())
return true;
m_frameCounter++;
- if (m_frameCounter >= kFrameUpdarePeriod)
+ if (m_frameCounter >= (is3d ? kFrameUpdarePeriodIn3d : kFrameUpdarePeriod))
m_frameCounter = -1;
return IsNeedUpdate();
diff --git a/drape/overlay_tree.hpp b/drape/overlay_tree.hpp
index 14e4f00b16..b65457f1cc 100644
--- a/drape/overlay_tree.hpp
+++ b/drape/overlay_tree.hpp
@@ -50,7 +50,7 @@ class OverlayTree : public m4::Tree<detail::OverlayInfo, detail::OverlayTraits>
public:
OverlayTree();
- bool Frame();
+ bool Frame(bool is3d);
bool IsNeedUpdate() const;
void ForceUpdate();
diff --git a/drape_frontend/arrow3d.cpp b/drape_frontend/arrow3d.cpp
index 016a02312e..5e93839c08 100644
--- a/drape_frontend/arrow3d.cpp
+++ b/drape_frontend/arrow3d.cpp
@@ -16,7 +16,7 @@ namespace df
double const kArrowSizeX = 2.0;
double const kArrowSizeY = 3.0;
-double const kArrow3dScale = 1.5;
+double const kArrow3dScale = 1.2;
Arrow3d::Arrow3d()
{
diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp
index 699c77c040..bb961ff1c6 100755
--- a/drape_frontend/frontend_renderer.cpp
+++ b/drape_frontend/frontend_renderer.cpp
@@ -655,7 +655,7 @@ FeatureID FrontendRenderer::GetVisiblePOI(m2::RectD const & pixelRect) const
void FrontendRenderer::BeginUpdateOverlayTree(ScreenBase const & modelView)
{
- if (m_overlayTree->Frame())
+ if (m_overlayTree->Frame(modelView.isPerspective()))
m_overlayTree->StartOverlayPlacing(modelView);
}
@@ -876,7 +876,9 @@ void FrontendRenderer::CheckMinAllowableIn3dScale()
m_userEventStream.IsInPerspectiveAnimation())
return;
- bool const switchTo2d = m_currentZoomLevel < scales::GetMinAllowableIn3dScale();
+ int const minScale = scales::GetMinAllowableIn3dScale() -
+ (df::VisualParams::Instance().GetVisualScale() <= 1.0 ? 1 : 0);
+ bool const switchTo2d = m_currentZoomLevel < minScale;
if ((!switchTo2d && !m_perspectiveDiscarded) ||
(switchTo2d && !m_userEventStream.GetCurrentScreen().isPerspective()))
diff --git a/drape_frontend/my_position_controller.cpp b/drape_frontend/my_position_controller.cpp
index 6d572d47a7..7fa7a14821 100644
--- a/drape_frontend/my_position_controller.cpp
+++ b/drape_frontend/my_position_controller.cpp
@@ -17,6 +17,7 @@ namespace
{
int const POSITION_Y_OFFSET = 75;
+int const POSITION_Y_OFFSET_3D = 80;
double const GPS_BEARING_LIFETIME_S = 5.0;
double const MIN_SPEED_THRESHOLD_MPS = 1.0;
@@ -93,6 +94,7 @@ MyPositionController::MyPositionController(location::EMyPositionMode initMode)
, m_position(m2::PointD::Zero())
, m_drawDirection(0.0)
, m_lastGPSBearing(false)
+ , m_positionYOffset(POSITION_Y_OFFSET)
, m_isVisible(false)
, m_isDirtyViewport(false)
{
@@ -115,6 +117,7 @@ void MyPositionController::SetPixelRect(m2::RectD const & pixelRect)
void MyPositionController::UpdatePixelPosition(ScreenBase const & screen)
{
+ m_positionYOffset = screen.isPerspective() ? POSITION_Y_OFFSET_3D : POSITION_Y_OFFSET;
m_pixelPositionRaF = screen.P3dtoP(GetRaFPixelBinding());
}
@@ -519,7 +522,7 @@ void MyPositionController::Follow(int preferredZoomLevel)
m2::PointD MyPositionController::GetRaFPixelBinding() const
{
return m2::PointD(m_pixelRect.Center().x,
- m_pixelRect.maxY() - POSITION_Y_OFFSET * VisualParams::Instance().GetVisualScale());
+ m_pixelRect.maxY() - m_positionYOffset * VisualParams::Instance().GetVisualScale());
}
m2::PointD MyPositionController::GetCurrentPixelBinding() const
diff --git a/drape_frontend/my_position_controller.hpp b/drape_frontend/my_position_controller.hpp
index 9c88198e44..3b883334c7 100644
--- a/drape_frontend/my_position_controller.hpp
+++ b/drape_frontend/my_position_controller.hpp
@@ -145,6 +145,7 @@ private:
m2::RectD m_pixelRect;
m2::PointD m_pixelPositionRaF;
+ double m_positionYOffset;
bool m_isVisible;
bool m_isDirtyViewport;
diff --git a/drape_frontend/user_event_stream.cpp b/drape_frontend/user_event_stream.cpp
index c8c8e8acfb..833fe35539 100644
--- a/drape_frontend/user_event_stream.cpp
+++ b/drape_frontend/user_event_stream.cpp
@@ -329,8 +329,10 @@ bool UserEventStream::SetCenter(m2::PointD const & center, int zoom, bool isAnim
ScreenBase const & currentScreen = GetCurrentScreen();
- bool const finishIn3d = m_discardedFOV > 0.0 && zoom >= scales::GetMinAllowableIn3dScale();
- bool const finishIn2d = currentScreen.isPerspective() && zoom < scales::GetMinAllowableIn3dScale();
+ int const minScale = scales::GetMinAllowableIn3dScale() -
+ df::VisualParams::Instance().GetVisualScale() <= 1.0 ? 1 : 0;
+ bool const finishIn3d = m_discardedFOV > 0.0 && zoom >= minScale;
+ bool const finishIn2d = currentScreen.isPerspective() && zoom < minScale;
ScreenBase screen = currentScreen;
if (finishIn3d)
diff --git a/indexer/scales.hpp b/indexer/scales.hpp
index 4a48cf7f98..713b5e2f4a 100644
--- a/indexer/scales.hpp
+++ b/indexer/scales.hpp
@@ -21,9 +21,9 @@ namespace scales
/// Default pedestrian navigation mode scale
inline int GetPedestrianNavigationScale() { return UPPER_STYLE_SCALE - 1; }
/// Default navigation 3d mode scale
- inline int GetNavigation3dScale() { return UPPER_STYLE_SCALE - 2; }
+ inline int GetNavigation3dScale() { return UPPER_STYLE_SCALE - 3; }
/// Default pedestrian navigation 3d mode scale
- inline int GetPedestrianNavigation3dScale() { return UPPER_STYLE_SCALE - 1; }
+ inline int GetPedestrianNavigation3dScale() { return UPPER_STYLE_SCALE - 2; }
/// Minimal allowable scale in 3d mode
inline int GetMinAllowableIn3dScale() { return 17; }
diff --git a/map/framework.cpp b/map/framework.cpp
index 7dca4dec93..839abaf914 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -2086,7 +2086,7 @@ void Framework::Save3dMode(bool allow)
bool Framework::Load3dMode()
{
- bool allow = false;
+ bool allow = true;
Settings::Get(kAllow3dKey, allow);
return allow;
}