Restore selection properly after an undo.

This commit is contained in:
Jeff Young 2019-06-29 19:57:23 +01:00
parent 51479c2042
commit 232e21cb37
3 changed files with 17 additions and 1 deletions

View File

@ -955,6 +955,9 @@ void EE_SELECTION_TOOL::RebuildSelection()
EDA_ITEM::IterateForward( start, inspector, nullptr, EE_COLLECTOR::AllItems );
updateReferencePoint();
// Inform other potentially interested tools
m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
}

View File

@ -548,6 +548,10 @@ int LIB_EDIT_TOOL::PinTable( const TOOL_EVENT& aEvent )
int LIB_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent )
{
m_frame->GetComponentFromUndoList();
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selTool->RebuildSelection();
return 0;
}
@ -555,6 +559,10 @@ int LIB_EDIT_TOOL::Undo( const TOOL_EVENT& aEvent )
int LIB_EDIT_TOOL::Redo( const TOOL_EVENT& aEvent )
{
m_frame->GetComponentFromRedoList();
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selTool->RebuildSelection();
return 0;
}

View File

@ -725,6 +725,9 @@ int SCH_EDITOR_CONTROL::Undo( const TOOL_EVENT& aEvent )
List->ReversePickersListOrder();
m_frame->GetScreen()->PushCommandToRedoList( List );
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selTool->RebuildSelection();
m_frame->SetSheetNumberAndCount();
m_frame->TestDanglingEnds();
@ -754,8 +757,10 @@ int SCH_EDITOR_CONTROL::Redo( const TOOL_EVENT& aEvent )
List->ReversePickersListOrder();
m_frame->GetScreen()->PushCommandToUndoList( List );
m_frame->SetSheetNumberAndCount();
EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
selTool->RebuildSelection();
m_frame->SetSheetNumberAndCount();
m_frame->TestDanglingEnds();
m_frame->SyncView();