From 232e21cb377be94d7dda0d6602e783ff68bcb677 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 29 Jun 2019 19:57:23 +0100 Subject: [PATCH] Restore selection properly after an undo. --- eeschema/tools/ee_selection_tool.cpp | 3 +++ eeschema/tools/lib_edit_tool.cpp | 8 ++++++++ eeschema/tools/sch_editor_control.cpp | 7 ++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index fc71708513..2fc0edbd36 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -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 ); } diff --git a/eeschema/tools/lib_edit_tool.cpp b/eeschema/tools/lib_edit_tool.cpp index 1281ae71d5..fad6bcc353 100644 --- a/eeschema/tools/lib_edit_tool.cpp +++ b/eeschema/tools/lib_edit_tool.cpp @@ -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(); + 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(); + selTool->RebuildSelection(); + return 0; } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index bf7fd4bc6c..79778b8e94 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -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(); + 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(); + selTool->RebuildSelection(); + m_frame->SetSheetNumberAndCount(); m_frame->TestDanglingEnds(); m_frame->SyncView();