From 411e87f9e03523ae6c3930a96d722ceaef57d9bf Mon Sep 17 00:00:00 2001 From: max-klaus Date: Sun, 15 Dec 2019 11:30:26 +0300 Subject: [PATCH] Fix tiles sampling on 28+ --- OsmAnd/src/net/osmand/plus/views/MapTileLayer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java index 2e6b677820..5154fe57e3 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java @@ -7,6 +7,7 @@ import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; +import android.os.Build; import android.widget.Toast; import net.osmand.data.QuadRect; @@ -40,6 +41,7 @@ public class MapTileLayer extends BaseMapLayer { protected ResourceManager resourceManager; protected OsmandSettings settings; private boolean visible = true; + private boolean useSampling; public MapTileLayer(boolean mainMap) { @@ -57,6 +59,8 @@ public class MapTileLayer extends BaseMapLayer { settings = view.getSettings(); resourceManager = view.getApplication().getResourceManager(); + useSampling = Build.VERSION.SDK_INT < 28; + paintBitmap = new Paint(); paintBitmap.setFilterBitmap(true); paintBitmap.setAlpha(getAlpha()); @@ -207,7 +211,7 @@ public class MapTileLayer extends BaseMapLayer { int xZoom = (tileX % div) * tileSize / div; int yZoom = (tileY % div) * tileSize / div; // nice scale - boolean useSampling = false;//kzoom > 3; + boolean useSampling = this.useSampling && kzoom > 3; bitmapToZoom.set(Math.max(xZoom, 0), Math.max(yZoom, 0), Math.min(xZoom + tileSize / div, tileSize), Math.min(yZoom + tileSize / div, tileSize));