Skip to content

Commit

Permalink
use pivotBy to move azimuth
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Sep 22, 2024
1 parent 3abe487 commit 4624ff4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gui/controls2_515/components/MapRotator.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Item {
property bool lockToPosition: false
onTriggered: {
var d = angle - map.view.angle;
d = (d > Math.PI ? d - 2.0*Math.PI : (d < -Math.PI ? d + 2.0*Math.PI : d));
if (d > 0.001 || d < -0.001) {
let a = (d > Math.PI ? angle - Math.PI*2.0 : d < -Math.PI ? angle + Math.PI*2.0 : angle);
map.rotateTo(a);
map.pivotBy(d);
} else {
stop();
finished();
Expand Down

0 comments on commit 4624ff4

Please sign in to comment.