Review fixes

This commit is contained in:
r.kuznetsov 2019-04-17 15:36:56 +03:00 committed by Daria Volvenkova
parent 83b80a02cd
commit 9b19b044b4
3 changed files with 8 additions and 7 deletions

View file

@ -491,10 +491,11 @@ bool UserEventStream::SetRect(m2::AnyRectD const & rect, bool isAnim, bool fitIn
ScreenBase tmp = GetCurrentScreen();
if (fitInViewport)
{
auto const useVisViewport = useVisibleViewport && m_visibleViewport.IsValid();
tmp.SetFromRects(rect, useVisViewport ? m_visibleViewport : tmp.PixelRectIn3d());
tmp.MatchGandP3d(rect.GlobalCenter(), useVisViewport ? m_visibleViewport.Center()
: tmp.PixelRectIn3d().Center());
auto viewportRect = tmp.PixelRectIn3d();
if (useVisibleViewport && m_visibleViewport.IsValid())
viewportRect = m_visibleViewport;
tmp.SetFromRects(rect, viewportRect);
tmp.MatchGandP3d(rect.GlobalCenter(), viewportRect.Center());
}
else
{

View file

@ -1253,10 +1253,10 @@ void Framework::ShowRect(m2::RectD const & rect, int maxScale, bool animation, b
useVisibleViewport);
}
void Framework::ShowRect(m2::AnyRectD const & rect, bool useVisibleViewport)
void Framework::ShowRect(m2::AnyRectD const & rect, bool animation, bool useVisibleViewport)
{
if (m_drapeEngine != nullptr)
m_drapeEngine->SetModelViewAnyRect(rect, true /* isAnim */, useVisibleViewport);
m_drapeEngine->SetModelViewAnyRect(rect, animation, useVisibleViewport);
}
void Framework::GetTouchRect(m2::PointD const & center, uint32_t pxRadius, m2::AnyRectD & rect)

View file

@ -634,7 +634,7 @@ public:
/// - Check minimal visible scale according to downloaded countries.
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 ShowRect(m2::AnyRectD const & rect, bool animation = true, bool useVisibleViewport = false);
void GetTouchRect(m2::PointD const & center, uint32_t pxRadius, m2::AnyRectD & rect);