Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2016-07-11 17:10:25 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2016-07-11 17:10:25 +0300
commitd6b837eb5d189c8943bfe2ced7286a95d74e4940 (patch)
treec394f1935c24231516105eb48671482f3b303189 /drape_frontend
parentc8f4a2e4d9154330c360406815819f9f5cac0d2d (diff)
Zoom on two touches fixed.
Diffstat (limited to 'drape_frontend')
-rw-r--r--drape_frontend/my_position_controller.cpp7
-rw-r--r--drape_frontend/navigator.cpp2
2 files changed, 5 insertions, 4 deletions
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;