diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index c356b595dd..ca209e2250 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -453,7 +453,7 @@ SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilt } -void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem ) +void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem, bool aForce ) { if( aItem->IsSelected() ) { @@ -468,7 +468,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem ) clearSelection(); // Prevent selection of invisible or inactive items - if( selectable( aItem ) ) + if( aForce || selectable( aItem ) ) { select( aItem ); @@ -1271,7 +1271,7 @@ int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent ) { KIGFX::VIEW_CONTROLS* viewCtrls = getViewControls(); clearSelection(); - toggleSelection( module ); + toggleSelection( module, true ); auto cursorPosition = viewCtrls->GetCursorPosition( false ); diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index 88eaca35fc..10b86cfc93 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -266,8 +266,9 @@ private: * Changes selection status of a given item. * * @param aItem is the item to have selection status changed. + * @param aForce causes the toggle to happen without checking selectability */ - void toggleSelection( BOARD_ITEM* aItem ); + void toggleSelection( BOARD_ITEM* aItem, bool aForce = false ); /** * Function selectable()