From d8ba6c07ac3d92b8edeacb6fa3957f8c1ee193df Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 14 Aug 2023 17:56:16 +0200 Subject: [PATCH] Pcbnew, DIALOG_PAD_PROPERTIES: ensure the right spoke angle is displayed. Previously it was sometimes the default value, not the initial value when opening the dialog. Fixes #15410 https://gitlab.com/kicad/code/kicad/-/issues/15410 --- pcbnew/dialogs/dialog_pad_properties.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 2ab600401f..2057b032ed 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -592,6 +592,10 @@ void DIALOG_PAD_PROPERTIES::initValues() m_trapAxisCtrl->SetSelection( 1 ); } + // Store the initial thermal spoke angle to restore it, because some initializations + // can change this value (mainly after m_PadShapeSelector initializations) + EDA_ANGLE spokeInitialAngle = m_previewPad->GetThermalSpokeAngle(); + m_padToDieOpt->SetValue( m_previewPad->GetPadToDieLength() != 0 ); m_padToDie.ChangeValue( m_previewPad->GetPadToDieLength() ); @@ -721,6 +725,11 @@ void DIALOG_PAD_PROPERTIES::initValues() OnPadShapeSelection( cmd_event ); OnOffsetCheckbox( cmd_event ); + // Restore thermal spoke angle to its initial value, because it can be modified + // by the call to OnPadShapeSelection() + m_previewPad->SetThermalSpokeAngle( spokeInitialAngle ); + m_spokeAngle.SetAngleValue( m_previewPad->GetThermalSpokeAngle() ); + // Update basic shapes list displayPrimitivesList(); }