Fix issue 1266

This commit is contained in:
Victor Shcherb 2012-08-26 01:32:02 +02:00
parent b112a8a6d3
commit 531899bb4b

View file

@ -242,20 +242,22 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall
res *= (float) Math.pow(2, zoom - (int) zoom); 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; return res;
} }
public int getSourceTileSize() { public int getSourceTileSize() {
if(mainLayer instanceof MapTileLayer){ int r = 256;
return ((MapTileLayer) mainLayer).getSourceTileSize(); 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;
} }
/** /**