From da0daffa896502de458f0a7027b78447b7faf3c8 Mon Sep 17 00:00:00 2001 From: John Beard Date: Sun, 30 Jul 2023 13:41:17 +0100 Subject: [PATCH] Remove more special-casing for fp-edit commit handling In the EDIT_TOOL::ModifyLines method, there was some remaining special-casing for FP childen commits. One bit was put back by mistake (in 0b32ae3f4b6c461f1506712b39d14844b4403f33) because I thought I'd left it out of the refactor. In fact it was removed slightly later in 1218f61d0ac8b765afdcd6c3543f42ec3a61b3c2. THe other bit is omitting Modify commits in the FP-editor (what the reinstatement of the above code was trying to cause). This shouldn't be needed any more. However, something is still incomplete here as the tools still don't work correctly in the footprint editor. However, I don't think it's substantially _more_ broken with the special casing removed and at least it's less confusing. Related to: https://gitlab.com/kicad/code/kicad/-/issues/15253 --- pcbnew/tools/edit_tool.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index f059bbcb5b..da21dd5e12 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1197,10 +1197,6 @@ int EDIT_TOOL::ModifyLines( const TOOL_EVENT& aEvent ) BOARD_COMMIT commit{ this }; - // Only modify one parent in FP editor - if( m_isFootprintEditor ) - commit.Modify( selection.Front() ); - // List of thing to select at the end of the operation // (doing it as we go will invalidate the iterator) std::vector items_to_select_on_success; @@ -1210,14 +1206,11 @@ int EDIT_TOOL::ModifyLines( const TOOL_EVENT& aEvent ) // and whether the item was conjured up by decomposing a polygon or rectangle const auto item_modification_handler = [&]( PCB_SHAPE& aItem ) { - if( !m_isFootprintEditor ) + // If the item was "conjured up" it will be added later separately + if( !alg::contains( lines_to_add, &aItem ) ) { - // If the item was "conjured up" it will be added later separately - if( !alg::contains( lines_to_add, &aItem ) ) - { - commit.Modify( &aItem ); - items_to_select_on_success.push_back( &aItem ); - } + commit.Modify( &aItem ); + items_to_select_on_success.push_back( &aItem ); } };