diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 9c152a8c75..9f874881b8 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -149,7 +149,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon if (objects != null) { int ex = (int) point.x; int ey = (int) point.y; - final int rp = getRadiusPoi(null, tb); + final int rp = getRadiusPoi(tb); int compare = rp; int radius = rp * 3 / 2; try { @@ -185,7 +185,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon mapTextLayer = view.getLayerByClass(MapTextLayer.class); } - public int getRadiusPoi(Amenity amenity, RotatedTileBox tb) { + public int getRadiusPoi(RotatedTileBox tb) { int r; final double zoom = tb.getZoom(); if (zoom < startZoom) { @@ -200,11 +200,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon r = 18; } - int radiusPoi = (int) (r * view.getScaleCoefficient()); - if (amenity != null && isPresentInFullObjects(amenity.getLocation())) { - radiusPoi += poiBackground.getHeight() / 2 - poiBackgroundSmall.getHeight() / 2; - } - return radiusPoi; + return (int) (r * view.getScaleCoefficient()); } @Override @@ -409,8 +405,13 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } @Override - public int getTextShift(Amenity o, RotatedTileBox rb) { - return getRadiusPoi(o, rb); + public int getTextShift(Amenity amenity, RotatedTileBox rb) { + int radiusPoi = getRadiusPoi(rb); + if (isPresentInFullObjects(amenity.getLocation())) { + radiusPoi += poiBackground.getHeight() / 2 - poiBackgroundSmall.getHeight() / 2; + } + + return radiusPoi; } @Override