diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 21cb0a8880..1a3b0c4b46 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -672,7 +672,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) auto& selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ) - { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED | EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS ); } ); + { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS ); }, nullptr, ! m_dragging ); if( selection.Empty() ) return 0; @@ -751,7 +751,7 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) { auto& selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ) - { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED | EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS ); } ); + { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS ); }, nullptr, ! m_dragging ); if( selection.Empty() ) return 0; @@ -833,7 +833,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) { auto& selection = m_selectionTool->RequestSelection( []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector ) - { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED | EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS ); } ); + { EditToolSelectionFilter( aCollector, EXCLUDE_LOCKED_PADS | EXCLUDE_TRANSIENTS ); }, nullptr, ! m_dragging ); if( selection.Empty() ) return 0; diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index ca209e2250..d4899be236 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -396,7 +396,7 @@ static EDA_RECT getRect( const BOARD_ITEM* aItem ) SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - std::vector* aFiltered ) + std::vector* aFiltered, bool aConfirmLockedItems ) { bool selectionEmpty = m_selection.Empty(); m_selection.SetIsHover( selectionEmpty ); @@ -406,7 +406,13 @@ SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilt m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, aClientFilter ); m_selection.ClearReferencePoint(); } - else if( aClientFilter ) + + if ( aConfirmLockedItems && CheckLock() == SELECTION_LOCKED ) + { + clearSelection(); + } + + if( aClientFilter ) { GENERAL_COLLECTOR collector; diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index 10b86cfc93..02de875e5c 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -96,7 +96,7 @@ public: * @param aFiltered is an optional vector, that is filled with items removed by the filter */ SELECTION& RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - std::vector* aFiltered = NULL ); + std::vector* aFiltered = NULL, bool aConfirmLockedItems = false ); inline TOOL_MENU& GetToolMenu()