Fix close button

This commit is contained in:
Victor Shcherb 2013-04-13 14:52:09 +02:00
parent 4a5c2e314e
commit b6974e6943

View file

@ -57,7 +57,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
private OsmandMapTileView view; private OsmandMapTileView view;
private int BASE_TEXT_SIZE = 170; private int BASE_TEXT_SIZE = 170;
private int SHADOW_OF_LEG = 5; private int SHADOW_OF_LEG = 5;
private int CLOSE_BTN = 6; private int CLOSE_BTN = 8;
private final MapActivity activity; private final MapActivity activity;
private Drawable boxLeg; private Drawable boxLeg;
@ -244,9 +244,10 @@ public class ContextMenuLayer extends OsmandMapLayer {
int y = (int) (py - view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude())); int y = (int) (py - view.getRotatedMapYForPoint(latLon.getLatitude(), latLon.getLongitude()));
x += bs.width() / 2; x += bs.width() / 2;
y += bs.height() + boxLeg.getMinimumHeight() - SHADOW_OF_LEG; y += bs.height() + boxLeg.getMinimumHeight() - SHADOW_OF_LEG;
int dclosex = x - bs.width() + CLOSE_BTN + closes.width(); int localSize = CLOSE_BTN * 3 / 2;
int dclosey = y + CLOSE_BTN; int dclosex = x - bs.width() + closes.width();
if(closes.intersects(dclosex - CLOSE_BTN, dclosey - CLOSE_BTN, dclosex + CLOSE_BTN, dclosey + CLOSE_BTN)) { int dclosey = y - closes.height() / 2;
if(closes.intersects(dclosex - localSize, dclosey - localSize, dclosex + localSize, dclosey + localSize)) {
return 2; return 2;
} else if (bs.contains(x, y)) { } else if (bs.contains(x, y)) {
return 1; return 1;