Skip to content

Commit

Permalink
Re-center map on position when adding vertex with a cursor locked to …
Browse files Browse the repository at this point in the history
…position and out of screen bounds (#6008)
  • Loading branch information
mohsenD98 authored Feb 19, 2025
1 parent fb4bf6a commit c11405d
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 + crosshairCircle.width <= 0 || crosshairCircle.x - crosshairCircle.width >= mainWindow.width || crosshairCircle.y + crosshairCircle.height <= 0 || crosshairCircle.y - crosshairCircle.height >= mainWindow.height;
if (outOfScreen) {
mapCanvas.mapSettings.setCenter(positionSource.projectedPosition, true);
}
}
}

/** Function to get the multiplier based on the selected tolerance
Expand Down

1 comment on commit c11405d

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.