diff --git a/ChangeLog b/ChangeLog index 75fd233f2..9cbd830ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,7 @@ Unreleased Version 2.2.2-pre * Fix: Properly save background color of annotations in ORA files. * Feature: Allow toggling a "sketch mode" on layers, which will change the opacity and/or tint the layer locally. The exact look of this can be configured in the layer properties. Thanks abrasivetroop and leandro2222 for suggesting. * Feature: Use the sketch mode tinting for onion skins as well, since it gives better results when there's colored areas involved. + * Fix: Properly update rotation when choosing an angle from the drop-down in the status bar when the angle is fractionally off the chosen angle. Thanks annoy for reporting. 2024-11-06 Version 2.2.2-beta.4 * Fix: Solve rendering glitches with selection outlines that happen on some systems. Thanks xxxx for reporting. diff --git a/src/desktop/widgets/viewstatus.cpp b/src/desktop/widgets/viewstatus.cpp index 6d1607245..dbf307fb2 100644 --- a/src/desktop/widgets/viewstatus.cpp +++ b/src/desktop/widgets/viewstatus.cpp @@ -76,20 +76,21 @@ ViewStatus::ViewStatus(QWidget *parent) m_angleBox->setEditable(true); m_angleBox->setToolTip(tr("Canvas Rotation")); + // Trailing spaces so that these always emit editTextChanged. m_angleBox->addItems({ - QStringLiteral("-135°"), - QStringLiteral("-90°"), - QStringLiteral("-45°"), - QStringLiteral("0°"), - QStringLiteral("45°"), - QStringLiteral("90°"), - QStringLiteral("135°"), - QStringLiteral("180°"), + QStringLiteral("-135° "), + QStringLiteral("-90° "), + QStringLiteral("-45° "), + QStringLiteral("0° "), + QStringLiteral("45° "), + QStringLiteral("90° "), + QStringLiteral("135 °"), + QStringLiteral("180 °"), }); m_angleBox->setEditText(QStringLiteral("0°")); m_angleBox->lineEdit()->setValidator(new QRegularExpressionValidator( - QRegularExpression("-?[0-9]{0,3}°?"), this)); + QRegularExpression("\\A\\s*-?[0-9]{0,3}°?\\s*"), this)); connect( m_angleBox, &QComboBox::editTextChanged, this, &ViewStatus::angleBoxChanged);