From cf6fd6475888bfb3c2bab8d4f903be092d661fd8 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 2 Oct 2022 12:59:40 +0100 Subject: [PATCH] Remove wxFloatingPointValidator which causes issues in some locales. Fixes https://gitlab.com/kicad/code/kicad/issues/12176 --- pcbnew/dialogs/dialog_graphic_item_properties.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index be34094011..e1fb5cf885 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -58,9 +58,6 @@ private: bool m_flipStartEnd; - wxFloatingPointValidator m_AngleValidator; - double m_AngleValue; - public: DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, BOARD_ITEM* aItem ); ~DIALOG_GRAPHIC_ITEM_PROPERTIES() {}; @@ -94,9 +91,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FR m_bezierCtrl1Y( aParent, m_BezierPointC1YLabel, m_BezierC1Y_Ctrl, m_BezierPointC1YUnit ), m_bezierCtrl2X( aParent, m_BezierPointC2XLabel, m_BezierC2X_Ctrl, m_BezierPointC2XUnit ), m_bezierCtrl2Y( aParent, m_BezierPointC2YLabel, m_BezierC2Y_Ctrl, m_BezierPointC2YUnit ), - m_flipStartEnd( false ), - m_AngleValidator( 1, &m_AngleValue ), - m_AngleValue( 0.0 ) + m_flipStartEnd( false ) { m_parent = aParent; m_item = dynamic_cast( aItem ); @@ -113,9 +108,6 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FR m_bezierCtrl2Y.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD ); m_angle.SetUnits( EDA_UNITS::DEGREES ); - m_AngleValidator.SetRange( -359.9, 359.9 ); - m_angleCtrl->SetValidator( m_AngleValidator ); - m_AngleValidator.SetWindow( m_angleCtrl ); // Do not allow locking items in the footprint editor m_locked->Show( dynamic_cast( aParent ) != nullptr ); @@ -189,7 +181,7 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow() case SHAPE_T::ARC: SetTitle( _( "Arc Properties" ) ); - m_AngleValue = m_item->GetArcAngle() / 10.0; + m_angle.SetDoubleValue( m_item->GetArcAngle() ); m_filledCtrl->Show( false ); break; @@ -310,7 +302,8 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow() if( m_item->GetShape() == SHAPE_T::ARC ) { - VECTOR2D center = CalcArcCenter( m_item->GetStart(), m_item->GetEnd(), m_AngleValue ); + VECTOR2D center = CalcArcCenter( m_item->GetStart(), m_item->GetEnd(), + m_angle.GetDoubleValue() / 10.0 ); m_item->SetCenter( wxPoint( KiROUND( center.x ), KiROUND( center.y ) ) ); }