From b6ea9afb4fdf1e6b109622889e7e8b0d90a758d4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 24 Nov 2021 09:44:13 +0100 Subject: [PATCH] DIALOG_PAD_PROPERTIES: fix 2 issues: missing initial value for roundrect corner radius and missing resize pad display panel (minor cosmetic issue). Fixes #9755 https://gitlab.com/kicad/code/kicad/issues/9755 Fixes #9703 https://gitlab.com/kicad/code/kicad/issues/9703 --- pcbnew/dialogs/dialog_pad_properties.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index e72d894e41..080be18c43 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -234,8 +234,13 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, PAD* aPad // Now all widgets have the size fixed, call FinishDialogSettings finishDialogSettings(); - wxUpdateUIEvent dummy; - OnUpdateUI( dummy ); + // Update widgets + wxUpdateUIEvent dummyUI; + OnUpdateUI( dummyUI ); + + // Post a dummy size event to force the pad preview panel to update the + // view: actual size, best zoom ... after the frame is shown + PostSizeEvent(); } @@ -345,6 +350,7 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas() void DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues() { // Note: use ChangeValue() to avoid generating a wxEVT_TEXT event + m_cornerRadius.ChangeValue( m_dummyPad->GetRoundRectCornerRadius() ); m_cornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 ); m_mixedCornerRatio.ChangeDoubleValue( m_dummyPad->GetRoundRectRadiusRatio() * 100.0 );