fix(cockpit): read a rounded-north destination heading as 000

359.6 degrees was shown as 360 degrees on the destination bearing while the compass tape uses 000.
This commit is contained in:
Rudy Celekli committed 2026-10-24 00:24:43 -04:00
1 parent 9d3548c27c
commit 05316bb34b
3 files changed
+20 -1

No files matched your search

+2 -1
View File
@@ -14,6 +14,7 @@ import {
formatAltitudeRulerTick,
formatCompassDivision,
formatCockpitEmergency,
formatHeadingReadout,
formatSpeedRulerTick,
normalizeHeading,
relativeBearing,
@@ -238,7 +239,7 @@ export function updateRoute(info) {
}
if (this.routeDirectionLabel) {
this.routeDirectionLabel.textContent = t('DEST {bearing}', {
bearing: `${String(Math.round(destinationBearing)).padStart(3, '0')}°`,
bearing: `${formatHeadingReadout(destinationBearing)}°`,
});
}
}