Fix for Issue 5538

This commit is contained in:
sonora 2018-10-26 10:53:49 +02:00
parent f1d34a3335
commit c00394fc43

View file

@ -123,7 +123,8 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
canvas.restore();
}
boolean isBearing = lastKnownLocation.hasBearing();
// Issue 5538: Some devices return positives for hasBearing() at rest, hence add 0.0 check:
boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0);
if (!locationOutdated && isBearing) {
float bearing = lastKnownLocation.getBearing();
canvas.rotate(bearing - 90, locationX, locationY);