From 32fa4a611a2bfa29f40aa47203a553daac8a2d7c Mon Sep 17 00:00:00 2001 From: LZX <1820455493@qq.com> Date: Tue, 20 Oct 2026 20:51:19 +0800 Subject: [PATCH] fix(location): instant viewport centering except on real location button click --- .../lzxnone/openloc/ui/screens/location/LocationScreen.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/lzxnone/openloc/ui/screens/location/LocationScreen.kt b/app/src/main/java/com/lzxnone/openloc/ui/screens/location/LocationScreen.kt index c6a95f8..0ffdd1e 100644 --- a/app/src/main/java/com/lzxnone/openloc/ui/screens/location/LocationScreen.kt +++ b/app/src/main/java/com/lzxnone/openloc/ui/screens/location/LocationScreen.kt @@ -381,7 +381,7 @@ fun LocationScreen( String.format(Locale.getDefault(), "%.5f, %.5f", AppPreferences.mockLatitude, AppPreferences.mockLongitude) } currentMarker?.title = locationName - mapViewRef?.controller?.animateTo(p) + mapViewRef?.controller?.setCenter(p) mapViewRef?.invalidate() } } else if (isVisible) { @@ -393,7 +393,7 @@ fun LocationScreen( val p = GeoPoint(gcj[0], gcj[1]) currentGeoPoint = p currentMarker?.position = p - mapViewRef?.controller?.animateTo(p) + mapViewRef?.controller?.setCenter(p) mapViewRef?.invalidate() coroutineScope.launch { val resolved = LocationResolver.resolveLocationName(context, realWgsLat, realWgsLng) @@ -502,7 +502,7 @@ fun LocationScreen( currentGeoPoint = mapPoint currentMarker?.position = mapPoint - mapViewRef?.controller?.animateTo(mapPoint) + mapViewRef?.controller?.setCenter(mapPoint) mapViewRef?.invalidate() locationName = result.name @@ -1304,7 +1304,7 @@ fun LocationScreen( pointOnMap = targetPoint, isUserManual = true, centerMap = true, - animate = true + animate = false ) locationName = favorite.name showFavoritesScreen = false