From ed698a6b3f9c9b946c4dc6268f9fc142266f242d Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 21 Oct 2019 12:36:01 +0300 Subject: [PATCH] Fix #7305 --- .../src/net/osmand/plus/views/POIMapLayer.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index edc4d8c87f..9c152a8c75 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -38,8 +38,8 @@ import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.poi.PoiUIFilter; import net.osmand.plus.render.RenderingIcons; -import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.IRouteInformationListener; +import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.views.MapTextLayer.MapTextProvider; import net.osmand.util.Algorithms; @@ -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(tb); + final int rp = getRadiusPoi(null, tb); int compare = rp; int radius = rp * 3 / 2; try { @@ -185,8 +185,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon mapTextLayer = view.getLayerByClass(MapTextLayer.class); } - - public int getRadiusPoi(RotatedTileBox tb) { + public int getRadiusPoi(Amenity amenity, RotatedTileBox tb) { int r; final double zoom = tb.getZoom(); if (zoom < startZoom) { @@ -200,7 +199,12 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } else { r = 18; } - return (int) (r * view.getScaleCoefficient()); + + int radiusPoi = (int) (r * view.getScaleCoefficient()); + if (amenity != null && isPresentInFullObjects(amenity.getLocation())) { + radiusPoi += poiBackground.getHeight() / 2 - poiBackgroundSmall.getHeight() / 2; + } + return radiusPoi; } @Override @@ -406,7 +410,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon @Override public int getTextShift(Amenity o, RotatedTileBox rb) { - return getRadiusPoi(rb); + return getRadiusPoi(o, rb); } @Override