This commit is contained in:
crimean 2019-02-06 14:51:21 +03:00
parent 56e6c31bc1
commit d738408157
2 changed files with 4 additions and 7 deletions

View file

@ -918,17 +918,13 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
if (map.isZooming() && map.hasCustomMapRatio()) { if (map.isZooming() && map.hasCustomMapRatio()) {
getMapActivity().changeZoom(2, System.currentTimeMillis()); getMapActivity().changeZoom(2, System.currentTimeMillis());
} else { } else {
if (!map.hasCustomMapRatio()) { setCustomMapRatio();
//setCustomMapRatio();
}
getMapActivity().changeZoom(1, System.currentTimeMillis()); getMapActivity().changeZoom(1, System.currentTimeMillis());
} }
} }
public void doZoomOut() { public void doZoomOut() {
if (!map.hasCustomMapRatio()) { setCustomMapRatio();
//setCustomMapRatio();
}
getMapActivity().changeZoom(-1, System.currentTimeMillis()); getMapActivity().changeZoom(-1, System.currentTimeMillis());
} }
@ -1250,6 +1246,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
public void onPause() { public void onPause() {
if (view != null) { if (view != null) {
restoreCustomMapRatio();
ViewParent parent = view.getParent(); ViewParent parent = view.getParent();
if (parent != null && containerLayoutListener != null) { if (parent != null && containerLayoutListener != null) {
((View) parent).removeOnLayoutChangeListener(containerLayoutListener); ((View) parent).removeOnLayoutChangeListener(containerLayoutListener);

View file

@ -511,7 +511,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
ry -= 0.35; ry -= 0.35;
} }
box.setCenterLocation(rx, ry); box.setCenterLocation(rx, ry);
LatLon screenCenter = box.getLatLonFromPixel(box.getPixWidth() / 2, box.getPixHeight() / 2); LatLon screenCenter = box.getLatLonFromPixel(box.getPixWidth() / 2f, box.getPixHeight() / 2f);
mapRatioX = 0; mapRatioX = 0;
mapRatioY = 0; mapRatioY = 0;
setLatLon(screenCenter.getLatitude(), screenCenter.getLongitude()); setLatLon(screenCenter.getLatitude(), screenCenter.getLongitude());