fix zoomCenter for doubleTapZoom
This commit is contained in:
parent
c9e8b4ef82
commit
480cb1e3ae
1 changed files with 7 additions and 4 deletions
|
@ -1029,8 +1029,11 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
|
|
||||||
final QuadPoint cp = initialViewport.getCenterPixelPoint();
|
final QuadPoint cp = initialViewport.getCenterPixelPoint();
|
||||||
// Keep zoom center fixed or flexible
|
// Keep zoom center fixed or flexible
|
||||||
//final LatLon r = calc.getLatLonFromPixel(cp.x + cp.x - initialMultiTouchCenterPoint.x, cp.y + cp.y - initialMultiTouchCenterPoint.y);
|
if (multiTouchSupport.isInZoomMode()) {
|
||||||
final LatLon r = calc.getLatLonFromPixel(cp.x + cp.x - multiTouchSupport.getCenterPoint().x, cp.y + cp.y - multiTouchSupport.getCenterPoint().y);
|
LatLon r = calc.getLatLonFromPixel(cp.x + cp.x - multiTouchSupport.getCenterPoint().x, cp.y + cp.y - multiTouchSupport.getCenterPoint().y);
|
||||||
|
} else {
|
||||||
|
LatLon r = calc.getLatLonFromPixel(cp.x + cp.x - initialMultiTouchCenterPoint.x, cp.y + cp.y - initialMultiTouchCenterPoint.y);
|
||||||
|
}
|
||||||
setLatLon(r.getLatitude(), r.getLongitude());
|
setLatLon(r.getLatitude(), r.getLongitude());
|
||||||
|
|
||||||
int baseZoom = initialViewport.getZoom();
|
int baseZoom = initialViewport.getZoom();
|
||||||
|
@ -1055,13 +1058,13 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
|
||||||
if (baseZoom > getMaxZoom()) {
|
if (baseZoom > getMaxZoom()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (baseZoom > getMaxZoom() - 1 && dz > 0) {
|
if (baseZoom > getMaxZoom() - 1 && dz >= 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (baseZoom < getMinZoom()) {
|
if (baseZoom < getMinZoom()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (baseZoom < getMinZoom() + 1 && dz < 0) {
|
if (baseZoom < getMinZoom() + 1 && dz <= -1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue