Skip to content

Compass: fix label positioning, readability in lock nose-up mode, and code cleanup#14051

Open
DieBorr wants to merge 4 commits intomavlink:masterfrom
DieBorr:compassRework
Open

Compass: fix label positioning, readability in lock nose-up mode, and code cleanup#14051
DieBorr wants to merge 4 commits intomavlink:masterfrom
DieBorr:compassRework

Conversation

@DieBorr
Copy link
Contributor

@DieBorr DieBorr commented Mar 1, 2026

Description

This PR fixes the launch label placement and orientation in the compass widget, keeps cardinal labels upright in lock nose-up mode, and simplifies the rotation logic.
Here are some screenshots, that show way better the changes:

Screenshot from 2026-03-01 15-34-22

The "L" label does not fit the compass Dial


Screenshot from 2026-03-01 15-35-08

The "L" label also rotates along with the compass

Overview

Screenshot from 2026-03-01 15-32-48 Screenshot from 2026-03-01 15-36-02

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/Build changes
  • Other

Testing

  • Tested locally
  • Added/updated unit tests
  • Tested with simulator (SITL)
  • Test

Platforms Tested

  • Linux

By submitting this pull request, I confirm that my contribution is made under the terms of the project's dual license (Apache 2.0 and GPL v3).

DieBorr added 4 commits March 1, 2026 15:48
In non-integrated compass layout the launch label was not fitting the
outter circle of the CompassDial.
In lock nose-up mode, the cardinal labels were rotated together with the
compass dial, negatively impacting readability. This change keeps them
upright to improve the user experience when having a quick look
to the UI.
The composed rotation was unnecessary, as the labels are rotated around
their center and can be rotated directly.
Copilot AI review requested due to automatic review settings March 1, 2026 15:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Flight Map compass widget to improve label placement/orientation (notably for the launch “L” indicator and cardinal labels) and simplifies rotation handling for the compass and its pointers.

Changes:

  • Refactors compass/pointer rotation from explicit transform: Rotation { ... } blocks to the rotation property.
  • Adjusts the launch (“L”) indicator positioning logic and keeps its text upright in lock nose-up mode.
  • Attempts to keep N/E/S/W labels upright in lock nose-up mode by counter-rotating them.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/FlightMap/Widgets/QGCCompassWidget.qml Simplifies rotation logic and tweaks launch label rotation/positioning.
src/FlightMap/Widgets/CompassDial.qml Adds counter-rotation to N/E/S/W labels for lock nose-up readability.
Comments suppressed due to low confidence (1)

src/FlightMap/Widgets/QGCCompassWidget.qml:66

  • CompassDial is still instantiated without passing the heading/lock-nose-up state. If the dial needs to counter-rotate its labels in lock nose-up mode, it should receive those values via properties (e.g., bind heading and lockNoseUpCompass to this widget’s _heading / _lockNoseUpCompass) so the component doesn’t rely on undefined external identifiers.
        rotation:           _lockNoseUpCompass ? -_heading : 0

        CompassDial {
            anchors.fill:   parent
            visible:        !usedByMultipleVehicleList
        }

transform: Translate {
property double _angle: _headingToHome
property double _angle: _headingToHome
property real _labelOffset: 1.1 * root.width / 2
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The launch label offset uses a hard-coded multiplier (1.1 * root.width / 2). This is a magic number and won’t reliably keep the indicator aligned/inside/outside the dial across different widget sizes and font metrics. Consider computing the radius based on the dial radius and the indicator’s own size (e.g., root.radius +/- parent.radius with a small margin) so the label positioning remains stable.

Suggested change
property real _labelOffset: 1.1 * root.width / 2
property real _labelOffset: root.radius - parent.width / 2 - ScreenTools.defaultFontPixelHeight * 0.25

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Pre-commit

Check Status Details
pre-commit Failed (non-blocking) View

Pre-commit hooks: 32 passed, 78 failed, 10 skipped.

Test Results

linux-sanitizers: 52 passed, 0 skipped

linux_gcc_64: 52 passed, 0 skipped

Total: 104 passed, 0 skipped

Code Coverage

Coverage: N/A

No baseline available for comparison

Artifact Sizes

Artifact Size
QGroundControl 328.30 MB
QGroundControl 318.73 MB
QGroundControl-aarch64 195.94 MB
QGroundControl-installer-AMD64 164.99 MB
QGroundControl-installer-AMD64-ARM64 76.93 MB
QGroundControl-installer-ARM64 77.87 MB
QGroundControl-mac 183.41 MB
QGroundControl-windows 183.45 MB
QGroundControl-x86_64 187.59 MB

No baseline available for comparison


Updated: 2026-03-01 16:00:08 UTC • Triggered by: Android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants