From 7642a9db79dba557b9b15d0b8407535d37e9a378 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 3 Feb 2022 17:08:19 -0800 Subject: [PATCH] Setup selection when repeating We need the item to be currently selected when repeating the last symbol insert. This ensures we have a valid selection before starting the move tool and possibly getting odd system behavior from mouse positions Fixes https://gitlab.com/kicad/code/kicad/issues/10619 --- eeschema/tools/sch_edit_tool.cpp | 1 + include/tool/selection.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 6c65db80c8..a322437d25 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -876,6 +876,7 @@ int SCH_EDIT_TOOL::RepeatDrawItem( const TOOL_EVENT& aEvent ) Mils2iu( cfg->m_Drawing.default_repeat_offset_y ) ) ); } + m_toolMgr->RunAction( EE_ACTIONS::addItemToSel, true, newItem ); newItem->SetFlags( IS_NEW ); m_frame->AddToScreen( newItem, m_frame->GetScreen() ); m_frame->SaveCopyInUndoList( m_frame->GetScreen(), newItem, UNDO_REDO::NEWITEM, false ); diff --git a/include/tool/selection.h b/include/tool/selection.h index 96379c127c..c9516812f6 100644 --- a/include/tool/selection.h +++ b/include/tool/selection.h @@ -183,7 +183,10 @@ public: VECTOR2I GetReferencePoint() const { - return *m_referencePoint; + if( m_referencePoint ) + return *m_referencePoint; + else + return GetBoundingBox().Centre(); } void SetReferencePoint( const VECTOR2I& aP )