From 669f4b87478d97c857b4944f84cb171b1a174643 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 10 Oct 2012 01:27:57 +0200 Subject: [PATCH] Make sure zoom is rounded to integer --- OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 330f411496..bf182338b1 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -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(); } }