From b1ddc1b1279271915a876d1bc35d86ab59ecdbf7 Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 18 Oct 2019 15:19:57 +0300 Subject: [PATCH] Fix #7378 --- .../src/net/osmand/plus/base/MapViewTrackingUtilities.java | 6 +++--- OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 9cf4e72a28..e07e04d1d4 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -128,7 +128,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc myLocation != null && isSmallSpeedForDirectionOfMovement(myLocation, speedForDirectionOfMovement); if ((settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_COMPASS || (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING && smallSpeedForDirectionOfMovement)) && !routePlanningMode) { if (Math.abs(MapUtils.degreesDiff(mapView.getRotate(), -val)) > 1.0) { - mapView.setRotate(-val); + mapView.setRotate(-val, false); } } else if (showViewAngle && headingChanged) { mapView.refreshMap(); @@ -208,7 +208,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc mapView.getAnimatedDraggingThread().startZooming(zoom.first, zoom.second, false); } if (rotation != null) { - mapView.setRotate(rotation); + mapView.setRotate(rotation, false); } mapView.setLatLon(location.getLatitude(), location.getLongitude()); } @@ -264,7 +264,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc public void updateSettings(){ if (mapView != null) { if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE || routePlanningMode) { - mapView.setRotate(0); + mapView.setRotate(0, true); } mapView.setMapPosition(settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING && !routePlanningMode diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 9909badc2c..a84587cc3d 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -399,10 +399,10 @@ public class OsmandMapTileView implements IMapDownloaderCallback { return getZoom() > LOWEST_ZOOM_TO_ROTATE; } - public void setRotate(float rotate) { + public void setRotate(float rotate, boolean force) { if (isMapRotateEnabled()) { float diff = MapUtils.unifyRotationDiff(rotate, getRotate()); - if (Math.abs(diff) > 5) { // check smallest rotation + if (Math.abs(diff) > 5 || force) { // check smallest rotation animatedDraggingThread.startRotate(rotate); } }