diff --git a/drape_frontend/my_position_controller.cpp b/drape_frontend/my_position_controller.cpp index 0feaf86a64..0fdc0cd458 100644 --- a/drape_frontend/my_position_controller.cpp +++ b/drape_frontend/my_position_controller.cpp @@ -195,9 +195,10 @@ void MyPositionController::CorrectScalePoint(m2::PointD & pt1, m2::PointD & pt2) { if (IsModeChangeViewport()) { - m2::PointD const oldPt1(pt1); - pt1 = GetRotationPixelCenter(); - pt2 = pt2 - oldPt1 + pt1; + m2::PointD const offset = (pt2 - pt1) / 2.0; + m2::PointD const center = GetRotationPixelCenter(); + pt1 = center - offset; + pt2 = center + offset; } } diff --git a/drape_frontend/navigator.cpp b/drape_frontend/navigator.cpp index 08e7685980..37461729dc 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; + m2::PointD const center3d = (oldPt1 + oldPt2) / 2.0; m2::PointD const center2d = screen.P3dtoP(center3d); m2::PointD const centerG = screen.PtoG(center2d); m2::PointD const offset = center2d - center3d;