aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-08-19 22:51:36 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-08-19 22:51:36 +0200
commit4961c91fd36c9d255633c21e7dcbe0487f7a3ad0 (patch)
treea04ebe050bb1ce2b24244c6b18ceda5d9cb47e78 /main
parent02c73e37cef8ff477bce32c8692b82d0db53aefe (diff)
downloadcgeo-4961c91fd36c9d255633c21e7dcbe0487f7a3ad0.zip
cgeo-4961c91fd36c9d255633c21e7dcbe0487f7a3ad0.tar.gz
cgeo-4961c91fd36c9d255633c21e7dcbe0487f7a3ad0.tar.bz2
#3122: always have connection to current position
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/maps/PositionOverlay.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/maps/PositionOverlay.java b/main/src/cgeo/geocaching/maps/PositionOverlay.java
index 39f4987..b371eae 100644
--- a/main/src/cgeo/geocaching/maps/PositionOverlay.java
+++ b/main/src/cgeo/geocaching/maps/PositionOverlay.java
@@ -139,7 +139,11 @@ public class PositionOverlay implements GeneralOverlay {
positionHistory.rememberTrailPosition(coordinates);
if (Settings.isMapTrail()) {
- int size = positionHistory.getHistory().size();
+ // always add current position to drawn history to have a closed connection
+ final ArrayList<Location> paintHistory = new ArrayList<Location>(positionHistory.getHistory());
+ paintHistory.add(coordinates);
+
+ int size = paintHistory.size();
if (size > 1) {
int alphaCnt = size - 201;
if (alphaCnt < 1) {
@@ -148,11 +152,11 @@ public class PositionOverlay implements GeneralOverlay {
Point pointNow = new Point();
Point pointPrevious = new Point();
- Location prev = positionHistory.getHistory().get(0);
+ Location prev = paintHistory.get(0);
projection.toPixels(mapItemFactory.getGeoPointBase(new Geopoint(prev)), pointPrevious);
for (int cnt = 1; cnt < size; cnt++) {
- Location now = positionHistory.getHistory().get(cnt);
+ Location now = paintHistory.get(cnt);
projection.toPixels(mapItemFactory.getGeoPointBase(new Geopoint(now)), pointNow);
int alpha;