From 6e151786ce7fc4b906db3b566be15e5b2b0bfd88 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sun, 1 Sep 2019 10:22:28 +0300 Subject: [PATCH] Fix #7491 --- .../osmand/plus/mapcontextmenu/MapContextMenuFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java index ab78e3f90a..0e60f07b4f 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java @@ -1734,7 +1734,10 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo private void showOnMap(LatLon latLon, boolean updateCoords, boolean alreadyAdjusted, int zoom) { AnimateDraggingMapThread thread = map.getAnimatedDraggingThread(); - zoom = Math.min(zoom, thread.calculateMoveZoom(null, latLon.getLatitude(), latLon.getLongitude(), null)); + int calculatedZoom = thread.calculateMoveZoom(null, latLon.getLatitude(), latLon.getLongitude(), null); + if (calculatedZoom > 0) { + zoom = Math.min(zoom, calculatedZoom); + } LatLon calcLatLon = calculateCenterLatLon(latLon, zoom, updateCoords); if (updateCoords) { mapCenter = calcLatLon;