Skip to content

Fix negative values overflowing vertically in the Relative Altitude Indicator#2494

Draft
rafaellehmkuhl wants to merge 2 commits into
bluerobotics:masterfrom
rafaellehmkuhl:issue-2419-fix-altitude-negative-overflow
Draft

Fix negative values overflowing vertically in the Relative Altitude Indicator#2494
rafaellehmkuhl wants to merge 2 commits into
bluerobotics:masterfrom
rafaellehmkuhl:issue-2419-fix-altitude-negative-overflow

Conversation

@rafaellehmkuhl
Copy link
Copy Markdown
Member

Fix #2419


const altitude = ref(0)
watch(store.altitude, () => (altitude.value = store.altitude.rel))
watch(store.altitude, () => (altitude.value = Math.max(0, store.altitude.rel)))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you take off on a mountain or cliff, and you fly down from where you start, relative altitude can (and should) be negative

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that definitely makes sense. Will adjust.

…ping

Increase container widths and add whitespace-nowrap to prevent the
value and unit from wrapping onto separate lines with negative numbers.
Negative relative altitude values are not meaningful for display, so
clamp to zero to avoid showing confusing negative readings.
@rafaellehmkuhl rafaellehmkuhl force-pushed the issue-2419-fix-altitude-negative-overflow branch from fd08945 to 6bc9afb Compare March 12, 2026 18:58
@rafaellehmkuhl rafaellehmkuhl marked this pull request as draft April 7, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relative Altitude indicator (mini-widget) overflows for negative numbers

2 participants