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

View file

@ -511,7 +511,7 @@ public class OsmandMapTileView implements IMapDownloaderCallback {
ry -= 0.35;
}
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;
mapRatioY = 0;
setLatLon(screenCenter.getLatitude(), screenCenter.getLongitude());