From 27d8df1122ca91df47643d349f50da2bf94bf5bc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 31 Dec 2021 23:31:18 +0000 Subject: [PATCH] Don't update units for UNSCALED, PERCENT or DEGREES. Fixes https://gitlab.com/kicad/code/kicad/issues/10020 --- common/widgets/unit_binder.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/widgets/unit_binder.cpp b/common/widgets/unit_binder.cpp index 07f121a5f0..a84dff84b2 100644 --- a/common/widgets/unit_binder.cpp +++ b/common/widgets/unit_binder.cpp @@ -115,11 +115,16 @@ void UNIT_BINDER::SetDataType( EDA_DATA_TYPE aDataType ) void UNIT_BINDER::onUnitsChanged( wxCommandEvent& aEvent ) { - int temp = (int) GetValue(); + if( m_units != EDA_UNITS::UNSCALED + && m_units != EDA_UNITS::DEGREES + && m_units != EDA_UNITS::PERCENT ) + { + int temp = (int) GetValue(); - SetUnits( m_frame->GetUserUnits() ); + SetUnits( m_frame->GetUserUnits() ); - SetValue( temp ); + SetValue( temp ); + } aEvent.Skip(); }