From d638f4cad075159bf72421eab3d045fec65e7eaa Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 24 Dec 2023 19:40:10 +0000 Subject: [PATCH] Record nested footprints for collision checking. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16410 (cherry picked from commit 6a5adc7646c787820f475392c959ba727cac1b40) --- pcbnew/tools/edit_tool_move_fct.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pcbnew/tools/edit_tool_move_fct.cpp b/pcbnew/tools/edit_tool_move_fct.cpp index 6d80988593..a4aea70bcb 100644 --- a/pcbnew/tools/edit_tool_move_fct.cpp +++ b/pcbnew/tools/edit_tool_move_fct.cpp @@ -644,10 +644,22 @@ int EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, const wxString& aCommi } else { - for( BOARD_ITEM* item : sel_items ) + if( showCourtyardConflicts ) { - if( showCourtyardConflicts && item->Type() == PCB_FOOTPRINT_T ) - drc_on_move->m_FpInMove.push_back( static_cast( item ) ); + std::vector& FPs = drc_on_move->m_FpInMove; + + for( BOARD_ITEM* item : sel_items ) + { + if( item->Type() == PCB_FOOTPRINT_T ) + FPs.push_back( static_cast( item ) ); + + item->RunOnDescendants( + [&]( BOARD_ITEM* descendent ) + { + if( descendent->Type() == PCB_FOOTPRINT_T ) + FPs.push_back( static_cast( descendent ) ); + } ); + } } m_cursor = grid.BestDragOrigin( originalCursorPos, sel_items,