Skip to content

Commit

Permalink
Recenter if out of screen and locked.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenD98 authored and github-actions[bot] committed Feb 19, 2025
1 parent 3fbbfe5 commit 964612f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/qml/CoordinateLocator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 964612f

Please sign in to comment.