aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/maps/DistanceDrawer.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/maps/DistanceDrawer.java b/main/src/cgeo/geocaching/maps/DistanceDrawer.java
index f2d11bb..9dde8e6 100644
--- a/main/src/cgeo/geocaching/maps/DistanceDrawer.java
+++ b/main/src/cgeo/geocaching/maps/DistanceDrawer.java
@@ -17,7 +17,6 @@ import android.util.DisplayMetrics;
import android.view.WindowManager;
public class DistanceDrawer {
- private Geopoint currentCoords;
private final Geopoint destinationCoords;
private Paint paintBox = null;
@@ -56,15 +55,15 @@ public class DistanceDrawer {
maxTextWidth = boxWidth - 3 * boxPadding;
}
- public void setCoordinates(final Location coordinatesIn) {
- currentCoords = new Geopoint(coordinatesIn);
+ public void setCoordinates(final Location location) {
+ final Geopoint currentCoords = new Geopoint(location);
final float distance = currentCoords.distanceTo(destinationCoords);
distanceText = Units.getDistanceFromKilometers(distance);
}
void drawDistance(final Canvas canvas) {
- if (currentCoords == null) {
+ if (distanceText == null) {
return;
}