Fix java rendering style

This commit is contained in:
vshcherb 2013-08-17 12:23:06 +02:00
parent ca04fe9415
commit dc9d7d2501
2 changed files with 7 additions and 20 deletions

View file

@ -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);
}
}
}

View file

@ -242,20 +242,13 @@ 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);
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);
}
}
}
drawWrappedText(cv, text, textSize);
}