Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f899842417
1 changed files with 2 additions and 9 deletions
|
@ -1031,17 +1031,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
calc.setRotate(calcRotate);
|
calc.setRotate(calcRotate);
|
||||||
calc.setZoomAndAnimation(initialViewport.getZoom(), dz, initialViewport.getZoomFloatPart());
|
calc.setZoomAndAnimation(initialViewport.getZoom(), dz, initialViewport.getZoomFloatPart());
|
||||||
|
|
||||||
//Try some slop logic here to better facilitate two finger tap zoom without losing map-linked-to-location
|
|
||||||
boolean suppressLoseLinkToLocation = ((multiTouchSupport.getCenterPoint().x - initialMultiTouchCenterPoint.x)
|
|
||||||
* (multiTouchSupport.getCenterPoint().x - initialMultiTouchCenterPoint.x)
|
|
||||||
+ (multiTouchSupport.getCenterPoint().y - initialMultiTouchCenterPoint.y)
|
|
||||||
* (multiTouchSupport.getCenterPoint().y - initialMultiTouchCenterPoint.y))
|
|
||||||
< 900;
|
|
||||||
|
|
||||||
final QuadPoint cp = initialViewport.getCenterPixelPoint();
|
final QuadPoint cp = initialViewport.getCenterPixelPoint();
|
||||||
// Keep zoom center fixed or flexible
|
// Keep zoom center fixed or flexible
|
||||||
LatLon r;
|
LatLon r;
|
||||||
if (multiTouchSupport.isInZoomMode() && !suppressLoseLinkToLocation) {
|
if (multiTouchSupport.isInZoomMode()) {
|
||||||
r = calc.getLatLonFromPixel(cp.x + cp.x - multiTouchSupport.getCenterPoint().x, cp.y + cp.y - multiTouchSupport.getCenterPoint().y);
|
r = calc.getLatLonFromPixel(cp.x + cp.x - multiTouchSupport.getCenterPoint().x, cp.y + cp.y - multiTouchSupport.getCenterPoint().y);
|
||||||
} else {
|
} else {
|
||||||
r = calc.getLatLonFromPixel(cp.x + cp.x - initialMultiTouchCenterPoint.x, cp.y + cp.y - initialMultiTouchCenterPoint.y);
|
r = calc.getLatLonFromPixel(cp.x + cp.x - initialMultiTouchCenterPoint.x, cp.y + cp.y - initialMultiTouchCenterPoint.y);
|
||||||
|
@ -1061,7 +1054,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
dz = Math.signum(dz);
|
dz = Math.signum(dz);
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomToAnimate(baseZoom, dz, !(doubleTapScaleDetector.isInZoomMode() || suppressLoseLinkToLocation));
|
zoomToAnimate(baseZoom, dz, !(doubleTapScaleDetector.isInZoomMode()));
|
||||||
rotateToAnimate(calcRotate);
|
rotateToAnimate(calcRotate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue