Make sure zoom is rounded to integer

This commit is contained in:
Victor Shcherb 2012-10-10 01:27:57 +02:00
parent e499a16e1a
commit 669f4b8747

View file

@ -282,9 +282,10 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall
}
public void setZoom(float zoom) {
if (mainLayer != null && zoom <= mainLayer.getMaximumShownMapZoom() && zoom >= mainLayer.getMinimumShownMapZoom()) {
if (mainLayer != null && zoom <= mainLayer.getMaximumShownMapZoom() + 0.01 && zoom >= mainLayer.getMinimumShownMapZoom() - 0.01) {
animatedDraggingThread.stopAnimating();
this.zoom = zoom;
// avoid round error
this.zoom = zoom + 0.001f;
refreshMap();
}
}