Merge pull request #4407 from darina/visible-viewport-ios-fix

Positioning on a search result fixed.
This commit is contained in:
Roman Kuznetsov 2016-09-29 15:13:13 +04:00 committed by GitHub
commit fef30938be
2 changed files with 3 additions and 2 deletions

View file

@ -1455,7 +1455,7 @@ void FrontendRenderer::OnTouchMapAction()
bool FrontendRenderer::OnNewVisibleViewport(m2::RectD const & oldViewport, m2::RectD const & newViewport, m2::PointD & gOffset)
{
gOffset = m2::PointD(0, 0);
if (m_myPositionController->IsModeChangeViewport() || m_selectionShape == nullptr)
if (m_myPositionController->IsModeChangeViewport() || m_selectionShape == nullptr || oldViewport == newViewport)
return false;
ScreenBase const & screen = m_userEventStream.GetCurrentScreen();
@ -1487,8 +1487,8 @@ bool FrontendRenderer::OnNewVisibleViewport(m2::RectD const & oldViewport, m2::R
pOffset.y = newViewport.maxY() - rect.maxY() - kOffset;
gOffset = screen.PtoG(screen.P3dtoP(pos + pOffset)) - screen.PtoG(screen.P3dtoP(pos));
return true;
}
return true;
}
return false;
}

View file

@ -364,6 +364,7 @@ void DrawWidget::resizeGL(int width, int height)
float w = m_ratio * width;
float h = m_ratio * height;
m_framework->OnSize(w, h);
m_framework->SetVisibleViewport(m2::RectD(0, 0, w, h));
if (m_skin)
{
m_skin->Resize(w, h);