Fix size of map icon

This commit is contained in:
Dima-1 2020-06-19 17:33:16 +03:00
parent 55a377cb47
commit 2e6343b28b

View file

@ -160,11 +160,12 @@ public class PointImageDrawable extends Drawable {
private void drawInCenter(Canvas canvas, Rect destRect, boolean history) {
this.history = history;
final float DEFAULT_SCALE_ON_MAP_1_5 = 1.5f;
setBounds(destRect);
int offsetX = destRect.centerX() - (int) (favIcon.getIntrinsicWidth() / 2 * scale);
int offsetY = destRect.centerY() - (int) (favIcon.getIntrinsicHeight() / 2 * scale);
favIcon.setBounds(offsetX, offsetY, (int) (offsetX + favIcon.getIntrinsicWidth() * scale),
offsetY + (int) (favIcon.getIntrinsicHeight() * scale));
int offsetX = destRect.centerX() - (int) (favIcon.getIntrinsicWidth() / 2 * scale * DEFAULT_SCALE_ON_MAP_1_5);
int offsetY = destRect.centerY() - (int) (favIcon.getIntrinsicHeight() / 2 * scale * DEFAULT_SCALE_ON_MAP_1_5);
favIcon.setBounds(offsetX, offsetY, (int) (offsetX + favIcon.getIntrinsicWidth() * scale * DEFAULT_SCALE_ON_MAP_1_5),
offsetY + (int) (favIcon.getIntrinsicHeight() * scale * DEFAULT_SCALE_ON_MAP_1_5));
draw(canvas);
}