From bd9fd0f1ee5130b90f9808592a88a9f74dcaf779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20P=C3=A9rez=20Alonso?= Date: Mon, 9 Dec 2024 14:47:29 +0100 Subject: [PATCH] Fix centering of inner circle in PhotoVideoControl The inner circle in the PhotoVideoControl widget was not always perfectly centered due to a mismatch in the parity of the parent and child widths. Adjusted the width calculation of the inner circle to ensure it has the same parity as its parent, resulting in proper centering. --- src/FlightMap/Widgets/PhotoVideoControl.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FlightMap/Widgets/PhotoVideoControl.qml b/src/FlightMap/Widgets/PhotoVideoControl.qml index 22bc144f3382..24ff25591329 100644 --- a/src/FlightMap/Widgets/PhotoVideoControl.qml +++ b/src/FlightMap/Widgets/PhotoVideoControl.qml @@ -166,7 +166,8 @@ Rectangle { Rectangle { anchors.centerIn: parent - width: parent.width * (_isShootingInCurrentMode ? 0.5 : 0.75) + // ensure width has the same parity as parent.width so that it gets properly centered + width: Math.floor(parent.width * (_isShootingInCurrentMode ? 0.5 : 0.75) / 2) * 2 + parent.width % 2 height: width radius: _isShootingInCurrentMode ? 0 : width * 0.5 color: _isShootingInCurrentMode || _canShootInCurrentMode ? qgcPal.colorRed : qgcPal.colorGrey