From 964612fe09a8b92292eb548e8893ef2e0dfd12fe Mon Sep 17 00:00:00 2001 From: Mohsen Date: Sun, 16 Feb 2025 23:52:06 +0330 Subject: [PATCH] Recenter if out of screen and locked. --- src/qml/CoordinateLocator.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/qml/CoordinateLocator.qml b/src/qml/CoordinateLocator.qml index b1b6c33933..95e0d5c37d 100644 --- a/src/qml/CoordinateLocator.qml +++ b/src/qml/CoordinateLocator.qml @@ -389,6 +389,12 @@ Item { function flash() { flashAnimation.start(); + if (positionLocked) { + const outOfScreen = crosshairCircle.x <= 0 || crosshairCircle.x >= mainWindow.width || crosshairCircle.y <= 0 || crosshairCircle.y >= mainWindow.height; + if (outOfScreen) { + mapCanvas.mapSettings.setCenter(positionSource.projectedPosition, true); + } + } } /** Function to get the multiplier based on the selected tolerance