diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-07-12 13:49:46 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2016-07-12 13:49:46 +0300 |
commit | 1d2194b9e1b4fb14494db955583cc8db9dbc630e (patch) | |
tree | 13ceb44b2c4ded68ee219c17606e6e33cad4616f /drape_frontend | |
parent | e97402290f1e181de5ba5c4cafa101faafde1b07 (diff) |
Navigator test fixed.
Diffstat (limited to 'drape_frontend')
-rw-r--r-- | drape_frontend/my_position_controller.cpp | 7 | ||||
-rw-r--r-- | drape_frontend/navigator.cpp | 5 |
2 files changed, 6 insertions, 6 deletions
diff --git a/drape_frontend/my_position_controller.cpp b/drape_frontend/my_position_controller.cpp index 0fdc0cd458..0feaf86a64 100644 --- a/drape_frontend/my_position_controller.cpp +++ b/drape_frontend/my_position_controller.cpp @@ -195,10 +195,9 @@ void MyPositionController::CorrectScalePoint(m2::PointD & pt1, m2::PointD & pt2) { if (IsModeChangeViewport()) { - m2::PointD const offset = (pt2 - pt1) / 2.0; - m2::PointD const center = GetRotationPixelCenter(); - pt1 = center - offset; - pt2 = center + offset; + m2::PointD const oldPt1(pt1); + pt1 = GetRotationPixelCenter(); + pt2 = pt2 - oldPt1 + pt1; } } diff --git a/drape_frontend/navigator.cpp b/drape_frontend/navigator.cpp index 37461729dc..8f8d0aba04 100644 --- a/drape_frontend/navigator.cpp +++ b/drape_frontend/navigator.cpp @@ -178,7 +178,7 @@ bool Navigator::ScaleImpl(m2::PointD const & newPt1, m2::PointD const & newPt2, bool skipMinScaleAndBordersCheck, bool doRotateScreen, ScreenBase & screen) { - m2::PointD const center3d = (oldPt1 + oldPt2) / 2.0; + m2::PointD const center3d = oldPt1; m2::PointD const center2d = screen.P3dtoP(center3d); m2::PointD const centerG = screen.PtoG(center2d); m2::PointD const offset = center2d - center3d; @@ -188,7 +188,8 @@ bool Navigator::ScaleImpl(m2::PointD const & newPt1, m2::PointD const & newPt2, doRotateScreen); ScreenBase tmp = screen; tmp.SetGtoPMatrix(newM); - tmp.MatchGandP3d(centerG, center3d); + if (tmp.isPerspective()) + tmp.MatchGandP3d(centerG, center3d); if (!skipMinScaleAndBordersCheck && !CheckMinScale(tmp)) return false; |