Fix java rendering style
This commit is contained in:
parent
ca04fe9415
commit
dc9d7d2501
2 changed files with 7 additions and 20 deletions
|
@ -315,14 +315,8 @@ public class OsmandRenderer {
|
||||||
// check bit b if it is set
|
// check bit b if it is set
|
||||||
if (((ind >> b) & 1) == 0) {
|
if (((ind >> b) & 1) == 0) {
|
||||||
alreadyDrawnIcons[i] = ind | (1 << b);
|
alreadyDrawnIcons[i] = ind | (1 << b);
|
||||||
if(rc.getDensityValue(1) != 1) {
|
cv.drawBitmap(ico, icon.x - ico.getWidth() / 2,
|
||||||
float left = icon.x - rc.getDensityValue(ico.getWidth() / 2);
|
icon.y - ico.getHeight() / 2, paintIcon);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,20 +242,13 @@ public class TextRenderer {
|
||||||
if (text.shieldRes != null) {
|
if (text.shieldRes != null) {
|
||||||
Bitmap ico = RenderingIcons.getIcon(context, text.shieldRes);
|
Bitmap ico = RenderingIcons.getIcon(context, text.shieldRes);
|
||||||
if (ico != null) {
|
if (ico != null) {
|
||||||
if (rc.getDensityValue(1) != 1) {
|
float left = text.centerX - ico.getWidth() / 2
|
||||||
float left = text.centerX - rc.getDensityValue(ico.getWidth() / 2) - 0.5f;
|
- 0.5f;
|
||||||
float top = text.centerY - rc.getDensityValue(ico.getHeight() / 2) - rc.getDensityValue(4.5f);
|
float top = text.centerY - ico.getHeight() / 2
|
||||||
Rect rec = new Rect(0, 0, ico.getWidth(), ico.getHeight());
|
- rc.getDensityValue(4.5f);
|
||||||
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);
|
cv.drawBitmap(ico, left, top, paintIcon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
drawWrappedText(cv, text, textSize);
|
drawWrappedText(cv, text, textSize);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue