diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 36141d4cab..0bd9a4d4fa 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -149,7 +149,7 @@ TOOL_ACTION PCB_ACTIONS::properties( "pcbnew.InteractiveEdit.properties", TOOL_ACTION PCB_ACTIONS::editModifiedSelection( "pcbnew.InteractiveEdit.ModifiedSelection", AS_GLOBAL, 0, - "", "" ); + "", "", nullptr, AF_NOTIFY ); TOOL_ACTION PCB_ACTIONS::measureTool( "pcbnew.InteractiveEdit.measureTool", AS_GLOBAL, MD_CTRL + MD_SHIFT + 'M', @@ -345,8 +345,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) } } - getView()->Update( &selection ); - m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, true ); + m_toolMgr->RunAction( PCB_ACTIONS::editModifiedSelection, false ); } else if( evt->IsCancel() || evt->IsActivate() ) diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/selection_tool.cpp index f8ae898a93..36f47bf662 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/selection_tool.cpp @@ -553,6 +553,7 @@ void SELECTION_TOOL::SetTransitions() Go( &SELECTION_TOOL::selectNet, PCB_ACTIONS::selectNet.MakeEvent() ); Go( &SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() ); Go( &SELECTION_TOOL::selectOnSheetFromEeschema, PCB_ACTIONS::selectOnSheetFromEeschema.MakeEvent() ); + Go( &SELECTION_TOOL::updateSelection, PCB_ACTIONS::editModifiedSelection.MakeEvent() ); } @@ -1758,6 +1759,14 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c } +int SELECTION_TOOL::updateSelection( const TOOL_EVENT& aEvent ) +{ + getView()->Update( &m_selection ); + + return 0; +} + + bool SELECTION_TOOL::SanitizeSelection() { std::set rejected; diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/selection_tool.h index aff8e499bc..c8396f212f 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/selection_tool.h @@ -308,6 +308,11 @@ private: */ void guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) const; + /** + * Event handler to update the selection VIEW_ITEM. + */ + int updateSelection( const TOOL_EVENT& aEvent ); + /// Pointer to the parent frame. PCB_BASE_FRAME* m_frame;