This commit is contained in:
crimean 2019-04-01 10:48:54 +03:00
parent 5097b75c70
commit 0077c78a78

View file

@ -937,10 +937,17 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
public void doZoomIn() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
if (map.isZooming() && map.hasCustomMapRatio()) {
RotatedTileBox tb = map.getCurrentRotatedTileBox().copy();
boolean containsLatLon = tb.containsLatLon(menu.getLatLon());
if (!containsLatLon) {
restoreCustomMapRatio();
}
if (map.isZooming() && (map.hasCustomMapRatio() || !containsLatLon)) {
mapActivity.changeZoom(2, System.currentTimeMillis());
} else {
if (containsLatLon) {
setCustomMapRatio();
}
mapActivity.changeZoom(1, System.currentTimeMillis());
}
}
@ -949,7 +956,13 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
public void doZoomOut() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
RotatedTileBox tb = map.getCurrentRotatedTileBox().copy();
boolean containsLatLon = tb.containsLatLon(menu.getLatLon());
if (containsLatLon) {
setCustomMapRatio();
} else {
restoreCustomMapRatio();
}
mapActivity.changeZoom(-1, System.currentTimeMillis());
}
}