diff options
Diffstat (limited to 'main/src/cgeo/geocaching/ui/CompassView.java')
| -rw-r--r-- | main/src/cgeo/geocaching/ui/CompassView.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/ui/CompassView.java b/main/src/cgeo/geocaching/ui/CompassView.java index 6f5b8b9..56cba9d 100644 --- a/main/src/cgeo/geocaching/ui/CompassView.java +++ b/main/src/cgeo/geocaching/ui/CompassView.java @@ -1,5 +1,6 @@ package cgeo.geocaching.ui; +import cgeo.geocaching.DirectionProvider; import cgeo.geocaching.R; import cgeo.geocaching.utils.PeriodicHandler; @@ -153,7 +154,8 @@ public class CompassView extends View { public void act() { final double newAzimuthShown = smoothUpdate(northMeasured, azimuthShown); final double newCacheHeadingShown = smoothUpdate(cacheHeadingMeasured, cacheHeadingShown); - if (Math.abs(newAzimuthShown - azimuthShown) >= 2 || Math.abs(newCacheHeadingShown - cacheHeadingShown) >= 2) { + if (Math.abs(DirectionProvider.difference(azimuthShown, newAzimuthShown)) >= 2 || + Math.abs(DirectionProvider.difference(cacheHeadingShown, newCacheHeadingShown)) >= 2) { synchronized(CompassView.this) { azimuthShown = newAzimuthShown; cacheHeadingShown = newCacheHeadingShown; |
