Keep compass responsive in north-up mode

This commit is contained in:
livio committed 2026-10-05 01:18:28 +02:00
1 parent a15c8e0b36
commit 260e0a3df5
3 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -624,11 +624,11 @@ function setCompassHeading(heading) {
function updateCompassDisplay() {
const element = lmeState.compassElement;
if (!element) return;
const rotation = lmeState.compassMode === "fixed" ? 0 : -lmeState.compassHeading;
const rotation = -lmeState.compassHeading;
element.classList.toggle("is-fixed", lmeState.compassMode === "fixed");
element.style.setProperty("--compass-rotation", `${rotation}deg`);
element.setAttribute("aria-label", lmeState.compassMode === "fixed"
? "Bussola: nord fisso in alto"
? `Bussola: mappa con nord fisso, orientamento ${Math.round(lmeState.compassHeading)} gradi`
: `Bussola: nord, orientamento ${Math.round(lmeState.compassHeading)} gradi`);
}