diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index 7fe9eaa00c..3982b8cc26 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -119,6 +119,7 @@ public class MultiTouchSupport { // } // return true; } else if(inZoomMode && actionCode == MotionEvent.ACTION_MOVE){ + centerPoint = new PointF((x1 + x2) / 2, (y1 + y2) / 2); if(angleDefined) { angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted); } diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index ba4a4e555a..7b663fbd43 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -1025,14 +1025,17 @@ public class OsmandMapTileView implements IMapDownloaderCallback { float dx = cp.x - initialMultiTouchCenterPoint.x; float dy = cp.y - initialMultiTouchCenterPoint.y; final RotatedTileBox calc = initialViewport.copy(); - calc.setLatLonCenter(initialCenterLatLon.getLatitude(), initialCenterLatLon.getLongitude()); + //calc.setLatLonCenter(initialCenterLatLon.getLatitude(), initialCenterLatLon.getLongitude()); + PointF updatedCenterPoint = multiTouchSupport.getCenterPoint(); + calc.setLatLonCenter(initialViewport.getLatLonFromPixel(updatedCenterPoint.x, updatedCenterPoint.y).getLatitude(), + initialViewport.getLatLonFromPixel(updatedCenterPoint.x, updatedCenterPoint.y).getLongitude()); float calcRotate = calc.getRotate() + angle; calc.setRotate(calcRotate); calc.setZoomAndAnimation(initialViewport.getZoom(), dz, initialViewport.getZoomFloatPart()); - final LatLon r = calc.getLatLonFromPixel(cp.x + dx, cp.y + dy); - setLatLon(r.getLatitude(), r.getLongitude()); + //final LatLon r = calc.getLatLonFromPixel(cp.x + dx, cp.y + dy); + //setLatLon(r.getLatitude(), r.getLongitude()); int baseZoom = initialViewport.getZoom(); while (initialViewport.getZoomFloatPart() + dz > 1 && isZoomingAllowed(baseZoom, dz)) { dz--;