Skip to content

Commit

Permalink
Fixed the Obstacle Overlay Offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio-Chies authored and MaEtUgR committed Dec 16, 2024
1 parent fc8c80a commit b3e66c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/FlightDisplay/ObstacleDistanceOverlayVideo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Item {
property var showText: obstacleDistance._showText

function drawSegment(ctx, range, centerX, centerY, lengthFrom, lengthTo, radFrom, radTo, grad) {
// Qt expects the angles to be in respect of the X axis, The Incoming Angles are in FRD From Front goind Clockwise
// Transform coordinates to Qt XY
radFrom -= Math.PI / 2
radTo -= Math.PI / 2
const topSrcX = centerX + lengthFrom * Math.cos(radFrom)
const topSrcY = centerY + lengthFrom * Math.sin(radFrom)
const topDstX = centerX + lengthFrom * Math.cos(radTo)
Expand Down

0 comments on commit b3e66c9

Please sign in to comment.