Fix marker touch events, fix #723

This commit is contained in:
Emux
2019-05-13 18:32:46 +03:00
parent 30ae0fb48f
commit 634d67a206
3 changed files with 6 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
- vtm-desktop-lwjgl module [#714](https://github.com/mapsforge/vtm/pull/714)
- vtm-desktop-lwjgl3 module [#717](https://github.com/mapsforge/vtm/pull/717)
- Fix marker touch events [#723](https://github.com/mapsforge/vtm/issues/723)
- Many other minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.12.0)

View File

@@ -2,7 +2,7 @@
* Copyright 2012 osmdroid authors: Nicolas Gramlich, Theodore Hong, Fred Eisele
*
* Copyright 2013 Hannes Janetzek
* Copyright 2016-2018 devemux86
* Copyright 2016-2019 devemux86
* Copyright 2016 Stephan Leuschner
* Copyright 2016 Pedinel
*
@@ -212,8 +212,8 @@ public class ItemizedLayer<Item extends MarkerInterface> extends MarkerLayer<Ite
mapPosition.toScreenPoint(item.getPoint(), mTmpPoint);
float dx = (float) (mTmpPoint.x - eventX);
float dy = (float) (mTmpPoint.y - eventY);
float dx = (float) (eventX - mTmpPoint.x);
float dy = (float) (eventY - mTmpPoint.y);
MarkerSymbol it = item.getMarker();
if (it == null)

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016 devemux86
* Copyright 2016-2019 devemux86
* Copyright 2016 Izumi Kawashima
* Copyright 2017 Longri
*
@@ -179,7 +179,7 @@ public class MarkerSymbol {
h = mTextureRegion.rect.h;
}
float ox = -w * mOffset.x;
float oy = -h * (1 - mOffset.y);
float oy = -h * mOffset.y;
return dx >= ox && dy >= oy && dx <= ox + w && dy <= oy + h;
}