Skip to content

Commit

Permalink
Fix precise view on compass-less devices
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 10, 2024
1 parent f1066b2 commit 513c216
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qml/PositioningPreciseView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Item {
property bool hasReachedTarget: hasAcceptableAccuracy && navigation.distance - positionSource.positionInformation.hacc - (precision / 10) <= 0
property bool hasAlarmSnoozed: false

property double positionX: Math.min(precision, navigation.distance) * Math.cos((navigation.bearing - positionSource.orientation - 90) * Math.PI / 180) * (preciseTarget.width / 2) / precision
property double positionY: Math.min(precision, navigation.distance) * Math.sin((navigation.bearing - positionSource.orientation - 90) * Math.PI / 180) * (preciseTarget.width / 2) / precision
property double positionX: Math.min(precision, navigation.distance) * Math.cos((navigation.bearing - (!isNaN(positionSource.orientation) ? positionSource.orientation : 0) - 90) * Math.PI / 180) * (preciseTarget.width / 2) / precision
property double positionY: Math.min(precision, navigation.distance) * Math.sin((navigation.bearing - (!isNaN(positionSource.orientation) ? positionSource.orientation : 0) - 90) * Math.PI / 180) * (preciseTarget.width / 2) / precision
property double positionZ: hasZ ? Math.min(precision, Math.max(-precision, -navigation.verticalDistance)) * ((preciseElevation.height - 15) / 2) / precision : 0.0
property point positionCenter: Qt.point(preciseTarget.width / 2 + preciseTarget.x + preciseTarget.parent.x,
preciseTarget.height / 2 + preciseTarget.y + preciseTarget.parent.y)
Expand Down Expand Up @@ -323,7 +323,7 @@ Item {
y: positionCenter.y + positionY - width / 2
width: 28
height: width
rotation: navigation.bearing - positionSource.orientation
rotation: navigation.bearing - (!isNaN(positionSource.orientation) ? positionSource.orientation : 0)

ShapePath {
strokeWidth: 1
Expand Down

1 comment on commit 513c216

@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.