Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f87f7bb5a3
2 changed files with 7 additions and 3 deletions
|
@ -119,6 +119,7 @@ public class MultiTouchSupport {
|
||||||
// }
|
// }
|
||||||
// return true;
|
// return true;
|
||||||
} else if(inZoomMode && actionCode == MotionEvent.ACTION_MOVE){
|
} else if(inZoomMode && actionCode == MotionEvent.ACTION_MOVE){
|
||||||
|
centerPoint = new PointF((x1 + x2) / 2, (y1 + y2) / 2);
|
||||||
if(angleDefined) {
|
if(angleDefined) {
|
||||||
angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted);
|
angleRelative = MapUtils.unifyRotationTo360(angle - angleStarted);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1025,14 +1025,17 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
float dx = cp.x - initialMultiTouchCenterPoint.x;
|
float dx = cp.x - initialMultiTouchCenterPoint.x;
|
||||||
float dy = cp.y - initialMultiTouchCenterPoint.y;
|
float dy = cp.y - initialMultiTouchCenterPoint.y;
|
||||||
final RotatedTileBox calc = initialViewport.copy();
|
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;
|
float calcRotate = calc.getRotate() + angle;
|
||||||
calc.setRotate(calcRotate);
|
calc.setRotate(calcRotate);
|
||||||
calc.setZoomAndAnimation(initialViewport.getZoom(),
|
calc.setZoomAndAnimation(initialViewport.getZoom(),
|
||||||
dz, initialViewport.getZoomFloatPart());
|
dz, initialViewport.getZoomFloatPart());
|
||||||
final LatLon r = calc.getLatLonFromPixel(cp.x + dx, cp.y + dy);
|
//final LatLon r = calc.getLatLonFromPixel(cp.x + dx, cp.y + dy);
|
||||||
setLatLon(r.getLatitude(), r.getLongitude());
|
//setLatLon(r.getLatitude(), r.getLongitude());
|
||||||
int baseZoom = initialViewport.getZoom();
|
int baseZoom = initialViewport.getZoom();
|
||||||
while (initialViewport.getZoomFloatPart() + dz > 1 && isZoomingAllowed(baseZoom, dz)) {
|
while (initialViewport.getZoomFloatPart() + dz > 1 && isZoomingAllowed(baseZoom, dz)) {
|
||||||
dz--;
|
dz--;
|
||||||
|
|
Loading…
Reference in a new issue