diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2019-04-15 10:50:45 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2019-04-17 19:04:36 +0300 |
commit | 83b80a02cdab5fc8664e91e79824573dbe945902 (patch) | |
tree | 259aeaa43c625c6d43fd387d8972fd5fa09cac5b /map | |
parent | 4745d564c79cb684511278fe24aa5f95709bab8c (diff) |
[drape] Added visible viewport usage in set-rect methods
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 18 | ||||
-rw-r--r-- | map/framework.hpp | 5 | ||||
-rw-r--r-- | map/routing_manager.cpp | 5 |
3 files changed, 16 insertions, 12 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index b6ee74669d..1b4a1092a2 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1184,7 +1184,7 @@ void Framework::LoadViewport() if (settings::Get("ScreenClipRect", rect) && df::GetWorldRect().IsRectInside(rect.GetGlobalRect())) { if (m_drapeEngine != nullptr) - m_drapeEngine->SetModelViewAnyRect(rect, false /* isAnim */); + m_drapeEngine->SetModelViewAnyRect(rect, false /* isAnim */, false /* useVisibleViewport */); } else { @@ -1194,8 +1194,10 @@ void Framework::LoadViewport() void Framework::ShowAll() { - if (m_drapeEngine != nullptr) - m_drapeEngine->SetModelViewAnyRect(m2::AnyRectD(m_model.GetWorldRect()), false /* isAnim */); + if (m_drapeEngine == nullptr) + return; + m_drapeEngine->SetModelViewAnyRect(m2::AnyRectD(m_model.GetWorldRect()), false /* isAnim */, + false /* useVisibleViewport */); } m2::PointD Framework::GetPixelCenter() const @@ -1242,19 +1244,19 @@ void Framework::SetVisibleViewport(m2::RectD const & rect) m_drapeEngine->SetVisibleViewport(rect); } -void Framework::ShowRect(m2::RectD const & rect, int maxScale, bool animation) +void Framework::ShowRect(m2::RectD const & rect, int maxScale, bool animation, bool useVisibleViewport) { if (m_drapeEngine == nullptr) return; - m_drapeEngine->SetModelViewRect(rect, true /* applyRotation */, - maxScale /* zoom */, animation); + m_drapeEngine->SetModelViewRect(rect, true /* applyRotation */, maxScale /* zoom */, animation, + useVisibleViewport); } -void Framework::ShowRect(m2::AnyRectD const & rect) +void Framework::ShowRect(m2::AnyRectD const & rect, bool useVisibleViewport) { if (m_drapeEngine != nullptr) - m_drapeEngine->SetModelViewAnyRect(rect, true /* isAnim */); + m_drapeEngine->SetModelViewAnyRect(rect, true /* isAnim */, useVisibleViewport); } void Framework::GetTouchRect(m2::PointD const & center, uint32_t pxRadius, m2::AnyRectD & rect) diff --git a/map/framework.hpp b/map/framework.hpp index 5a0697c85d..9ba4a7bfbc 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -632,8 +632,9 @@ public: void SetVisibleViewport(m2::RectD const & rect); /// - Check minimal visible scale according to downloaded countries. - void ShowRect(m2::RectD const & rect, int maxScale = -1, bool animation = true); - void ShowRect(m2::AnyRectD const & rect); + void ShowRect(m2::RectD const & rect, int maxScale = -1, bool animation = true, + bool useVisibleViewport = false); + void ShowRect(m2::AnyRectD const & rect, bool useVisibleViewport = false); void GetTouchRect(m2::PointD const & center, uint32_t pxRadius, m2::AnyRectD & rect); diff --git a/map/routing_manager.cpp b/map/routing_manager.cpp index c64162471a..5a1ebf3fd6 100644 --- a/map/routing_manager.cpp +++ b/map/routing_manager.cpp @@ -374,7 +374,8 @@ void RoutingManager::OnBuildRouteReady(Route const & route, RouterResultCode cod m2::RectD routeRect = route.GetPoly().GetLimitRect(); routeRect.Scale(kRouteScaleMultiplier); m_drapeEngine.SafeCall(&df::DrapeEngine::SetModelViewRect, routeRect, - true /* applyRotation */, -1 /* zoom */, true /* isAnim */); + true /* applyRotation */, -1 /* zoom */, true /* isAnim */, + true /* useVisibleViewport */); } CallRouteBuilded(hasWarnings ? RouterResultCode::HasWarnings : code, storage::CountriesVec()); @@ -1006,7 +1007,7 @@ void RoutingManager::BuildRoute(uint32_t timeoutSec) m2::RectD rect = ShowPreviewSegments(routePoints); rect.Scale(kRouteScaleMultiplier); m_drapeEngine.SafeCall(&df::DrapeEngine::SetModelViewRect, rect, true /* applyRotation */, - -1 /* zoom */, true /* isAnim */); + -1 /* zoom */, true /* isAnim */, true /* useVisibleViewport */); m_routingSession.SetUserCurrentPosition(routePoints.front().m_position); |