diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index a0748547f0..54073c0327 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -2070,22 +2070,16 @@ bool ROUTER_TOOL::CanInlineDrag( int aDragMode ) if( selection.Size() == 1 ) { - const BOARD_ITEM* item = static_cast( selection.Front() ); - - // Note: EDIT_TOOL::Drag temporarily handles items of type PCB_ARC_T on its own using - // DragArcTrack(), so PCB_ARC_T should never occur here. - if( item->IsType( GENERAL_COLLECTOR::DraggableItems ) ) - { - // Footprints cannot be dragged freely. - if( item->IsType( { PCB_FOOTPRINT_T } ) ) - return !( aDragMode & PNS::DM_FREE_ANGLE ); - else - return true; - } + return selection.Front()->IsType( GENERAL_COLLECTOR::DraggableItems ); } - else // more than 1 item - let's check if these are all track segments + else if( selection.CountType( PCB_FOOTPRINT_T ) == selection.Size() ) { - return selection.CountType( PCB_TRACE_T ) == selection.Size(); + // Footprints cannot be dragged freely. + return !( aDragMode & PNS::DM_FREE_ANGLE ); + } + else if( selection.CountType( PCB_TRACE_T ) == selection.Size() ) + { + return true; } return false; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 499d5e7b35..a85f4165f5 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -562,9 +562,16 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent ) } } - if( footprints.size() == (unsigned) aCollector.GetCount() ) + if( footprints.size() ) { - // We can drag multiple footprints; no need to whittle down selection. + /* + * Remove non-footprints + */ + for( int ii = aCollector.GetCount() - 1; ii >= 0; --ii ) + { + if( aCollector[ii]->Type() != PCB_FOOTPRINT_T ) + aCollector.Remove( ii ); + } } else if( tracks.size() || vias.size() ) {