Skip to content

Commit 6bc9afb

Browse files
mini-widgets: RelativeAltitudeIndicator: Clamp negative altitude to zero
Negative relative altitude values are not meaningful for display, so clamp to zero to avoid showing confusing negative readings.
1 parent f425561 commit 6bc9afb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/components/mini-widgets/RelativeAltitudeIndicator.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ import { useMainVehicleStore } from '@/stores/mainVehicle'
2020
const store = useMainVehicleStore()
2121
2222
const altitude = ref(0)
23-
watch(store.altitude, () => (altitude.value = store.altitude.rel))
23+
watch(store.altitude, () => (altitude.value = Math.max(0, store.altitude.rel)))
2424
</script>

0 commit comments

Comments
 (0)