From dc9d7d2501991b992d8a9d3d8c68707096cad78e Mon Sep 17 00:00:00 2001 From: vshcherb Date: Sat, 17 Aug 2013 12:23:06 +0200 Subject: [PATCH] Fix java rendering style --- .../net/osmand/plus/render/OsmandRenderer.java | 10 ++-------- .../net/osmand/plus/render/TextRenderer.java | 17 +++++------------ 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index c9d7cc9485..58ce233b67 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -315,14 +315,8 @@ public class OsmandRenderer { // check bit b if it is set if (((ind >> b) & 1) == 0) { alreadyDrawnIcons[i] = ind | (1 << b); - if(rc.getDensityValue(1) != 1) { - float left = icon.x - rc.getDensityValue(ico.getWidth() / 2); - float top = icon.y - rc.getDensityValue(ico.getHeight() / 2); - cv.drawBitmap(ico, null, new RectF(left, top, left + rc.getDensityValue(ico.getWidth()), top - + rc.getDensityValue(ico.getHeight())), paintIcon); - } else { - cv.drawBitmap(ico, icon.x - ico.getWidth() / 2, icon.y - ico.getHeight() / 2, paintIcon); - } + cv.drawBitmap(ico, icon.x - ico.getWidth() / 2, + icon.y - ico.getHeight() / 2, paintIcon); } } } diff --git a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java index 884e3f70e4..52d2594ac7 100644 --- a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java @@ -242,18 +242,11 @@ public class TextRenderer { if (text.shieldRes != null) { Bitmap ico = RenderingIcons.getIcon(context, text.shieldRes); if (ico != null) { - if (rc.getDensityValue(1) != 1) { - float left = text.centerX - rc.getDensityValue(ico.getWidth() / 2) - 0.5f; - float top = text.centerY - rc.getDensityValue(ico.getHeight() / 2) - rc.getDensityValue(4.5f); - Rect rec = new Rect(0, 0, ico.getWidth(), ico.getHeight()); - cv.drawBitmap(ico, rec, - new RectF(left, top, left + rc.getDensityValue(ico.getWidth()), top - + rc.getDensityValue(ico.getHeight())), paintIcon); - } else { - float left = text.centerX - ico.getWidth() / 2 - 0.5f; - float top = text.centerY - ico.getHeight() / 2 - rc.getDensityValue(4.5f); - cv.drawBitmap(ico, left, top, paintIcon); - } + float left = text.centerX - ico.getWidth() / 2 + - 0.5f; + float top = text.centerY - ico.getHeight() / 2 + - rc.getDensityValue(4.5f); + cv.drawBitmap(ico, left, top, paintIcon); } }