From 531899bb4b044338ee8f25d05590e37d2050a9cc Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 26 Aug 2012 01:32:02 +0200 Subject: [PATCH] Fix issue 1266 --- .../osmand/plus/views/OsmandMapTileView.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index dd44aac2db..319f55bdb2 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -242,20 +242,22 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall res *= (float) Math.pow(2, zoom - (int) zoom); } - // that trigger allows to scale tiles for certain devices - // for example for device with density > 1 draw tiles the same size as with density = 1 - // It makes text bigger but blurry, the settings could be introduced for that - if (dm != null && dm.density > 1f && !getSettings().USE_HIGH_RES_MAPS.get() ) { - res *= dm.density; - } + return res; } public int getSourceTileSize() { - if(mainLayer instanceof MapTileLayer){ - return ((MapTileLayer) mainLayer).getSourceTileSize(); + int r = 256; + if (mainLayer instanceof MapTileLayer) { + r = ((MapTileLayer) mainLayer).getSourceTileSize(); } - return 256; + // that trigger allows to scale tiles for certain devices + // for example for device with density > 1 draw tiles the same size as with density = 1 + // It makes text bigger but blurry, the settings could be introduced for that + if (dm != null && dm.density > 1f && !getSettings().USE_HIGH_RES_MAPS.get()) { + return (int) (r * dm.density); + } + return r; } /**