fix(GimbalIndicator): prevent angle text jittering in toolbar#14663
Open
DonLakeFlyer wants to merge 1 commit into
Open
fix(GimbalIndicator): prevent angle text jittering in toolbar#14663DonLakeFlyer wants to merge 1 commit into
DonLakeFlyer wants to merge 1 commit into
Conversation
Round displayed gimbal angles to whole degrees, normalize -0 to 0, show -- for NaN, and give the pitch/pan labels a fixed width based on the widest possible value so the toolbar no longer shifts as telemetry noise changes the value. Fixes mavlink#13427
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the gimbal toolbar indicator QML to stabilize the on-screen pitch/yaw/azimuth text, preventing visual “jitter” caused by minor telemetry fluctuations and changing digit widths.
Changes:
- Added a shared
formatAngle(...)helper to round displayed angles to whole degrees, normalize-0to0, and display--for invalid (NaN) values. - Introduced fixed-width angle labels using
TextMetricsso the toolbar layout does not shift when signs/digit counts change.
Contributor
|
See the Build Results workflow run for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the gimbal toolbar indicator angle text jittering around as telemetry noise changes the values.
-0to0so the sign doesn't flicker around zero--instead ofNaNwhen no valid angle has been receivedTextMetricson the widest possible value) so the toolbar no longer shifts when the digit count changes (e.g. 9 ↔ 10, sign appearing)Follows the approach discussed in #13204.
Fixes #13427
Testing
qmllintpre-commit hook passesctest -R ToolbarIndicatorUITestpasses (strict QML warning checking)