From 2545999b3db59e95babe73f493f33ed5af430be0 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 29 Nov 2023 16:15:03 +0000 Subject: [PATCH] Delete shapes re-combined into a pad. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16193 --- pcbnew/tools/pad_tool.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index d71e6d6aa4..9e1939ddb7 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -361,18 +361,20 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) STATUS_TEXT_POPUP statusPopup( frame() ); // Callable lambda to construct the pad number string for the given value - const auto constructPadNumber = [&]( int aValue ) - { - return wxString::Format( wxT( "%s%d" ), params->m_prefix.value_or( "" ), aValue ); - }; + const auto constructPadNumber = + [&]( int aValue ) + { + return wxString::Format( wxT( "%s%d" ), params->m_prefix.value_or( "" ), aValue ); + }; // Callable lambda to set the popup text for the given pad value - const auto setPopupTextForValue = [&]( int aValue ) - { - const wxString msg = - _( "Click on pad %s\nPress to cancel all; double-click to finish" ); - statusPopup.SetText( wxString::Format( msg, constructPadNumber( aValue ) ) ); - }; + const auto setPopupTextForValue = + [&]( int aValue ) + { + const wxString msg = _( "Click on pad %s\n" + "Press to cancel all; double-click to finish" ); + statusPopup.SetText( wxString::Format( msg, constructPadNumber( aValue ) ) ); + }; setPopupTextForValue( seqPadNum ); statusPopup.Popup(); @@ -629,7 +631,12 @@ int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent ) { BOARD_COMMIT commit( frame() ); commit.Modify( pad->GetParentFootprint() ); - RecombinePad( pad, false ); + + std::vector shapes = RecombinePad( pad, false ); + + for( PCB_SHAPE* shape : shapes ) + commit.Remove( shape ); + commit.Push( _( "Edit Pad" ) ); }