From 613044189ea1212d81b885d8010516f32a07cc07 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 13 Dec 2010 22:53:44 +0000 Subject: [PATCH] fix shields for high res (issue 268) git-svn-id: https://osmand.googlecode.com/svn/trunk@815 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- OsmAnd/src/net/osmand/ResourceManager.java | 7 ------- .../src/net/osmand/render/OsmandRenderer.java | 18 +++++++++--------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/ResourceManager.java b/OsmAnd/src/net/osmand/ResourceManager.java index afef8070c7..d5aeb8aff2 100644 --- a/OsmAnd/src/net/osmand/ResourceManager.java +++ b/OsmAnd/src/net/osmand/ResourceManager.java @@ -62,13 +62,6 @@ public class ResourceManager { protected static ResourceManager manager = null; -// public static ResourceManager getResourceManager(){ -// if(manager == null){ -// manager = new ResourceManager(); -// } -// return manager; -// } - // it is not good investigated but no more than 64 (satellite images) // Only 8 MB (from 16 Mb whole mem) available for images : image 64K * 128 = 8 MB (8 bit), 64 - 16 bit, 32 - 32 bit protected int maxImgCacheSize = 32; diff --git a/OsmAnd/src/net/osmand/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/render/OsmandRenderer.java index 445dbc46c4..72020736fd 100644 --- a/OsmAnd/src/net/osmand/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/render/OsmandRenderer.java @@ -434,23 +434,23 @@ public class OsmandRenderer { float mes = paintText.measureText(text.text); if(text.drawOnPath == null || (text.pathRotate > 45 && text.pathRotate < 135) || (text.pathRotate > 225 && text.pathRotate < 315)){ - bounds.set(text.centerX - mes / 2, text.centerY - 3 * text.textSize / 2, - text.centerX + mes / 2, text.centerY + 3 * text.textSize / 2); + bounds.set(text.centerX - mes / 2, text.centerY - 3 * text.textSize / 2 , + text.centerX + mes / 2 , text.centerY + 3 * text.textSize / 2 ); } else { - bounds.set(text.centerX - 3 * text.textSize / 2, text.centerY - mes/2, - text.centerX + 3 * text.textSize / 2, text.centerY + mes/2); + bounds.set(text.centerX - 3 * text.textSize , text.centerY - mes, + text.centerX + 3 * text.textSize , text.centerY + mes ); } if(text.minDistance > 0){ - bounds.set(bounds.left - text.minDistance / 2, bounds.top - text.minDistance / 2 - , bounds.right + text.minDistance / 2, bounds.bottom + text.minDistance / 2); + bounds.set(bounds.left - text.minDistance / 2, bounds.top - text.minDistance / 2, + bounds.right + text.minDistance / 2, bounds.bottom + text.minDistance / 2); } List boundsIntersect = text.drawOnPath == null || findAllTextIntersections? boundsNotPathIntersect : boundsPathIntersect; if(boundsIntersect.isEmpty()){ boundsIntersect.add(bounds); } else { - final int diff = (int) 3 ; - final int diff2 = (int) 15; + final int diff = (int) (3 * dm.density); + final int diff2 = (int) (15 * dm.density); // implement binary search int index = Collections.binarySearch(boundsIntersect, bounds, c); if (index < 0) { @@ -524,7 +524,7 @@ public class OsmandRenderer { } Bitmap ico = cachedIcons.get(text.shieldRes); if (ico != null) { - cv.drawBitmap(ico, text.centerX - ico.getWidth() / 2 - 0.5f, text.centerY - text.textSize - 2, paintIcon); + cv.drawBitmap(ico, text.centerX - ico.getWidth() / 2 - 0.5f * dm.density, text.centerY - text.textSize - 2 * dm.density, paintIcon); } } if(text.text.length() > text.textWrap){