From ade8fe4333ff340f8ef9714aa8c56887fba55809 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 25 Nov 2021 14:51:54 +0000 Subject: [PATCH] When dragging footprints pads with holes also need to be taken along. Otherwise (aside from not colliding with their dragged location) we won't update their locations and then if they happen to be the first pad in the footprint we'll try to update the footprint's location post- drag with the pad offset (which will be {0,0}. This is easily reproducible with the test document in the bug in the "fixes" statement. Fixes https://gitlab.com/kicad/code/kicad/issues/9391 --- pcbnew/router/pns_component_dragger.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcbnew/router/pns_component_dragger.cpp b/pcbnew/router/pns_component_dragger.cpp index c19e84420a..7138f569ea 100644 --- a/pcbnew/router/pns_component_dragger.cpp +++ b/pcbnew/router/pns_component_dragger.cpp @@ -117,14 +117,14 @@ bool COMPONENT_DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives ) if( item.item->Kind() != ITEM::SOLID_T ) continue; - if( ! item.item->IsRoutable() ) - continue; - auto solid = static_cast( item.item ); auto jt = m_world->FindJoint( solid->Pos(), solid ); m_solids.insert( solid ); + if( ! item.item->IsRoutable() ) + continue; + for( auto link : jt->LinkList() ) { if( link.item->OfKind( ITEM::SEGMENT_T | ITEM::ARC_T ) )