Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix precise view on compass-less devices #5023

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading