Skip to content

Commit

Permalink
Fix centering of inner circle in PhotoVideoControl
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rubenp02 committed Dec 9, 2024
1 parent 51ce11f commit bd9fd0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FlightMap/Widgets/PhotoVideoControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bd9fd0f

Please sign in to comment.