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

(cherry picked from commit 7642a9db79)
This commit is contained in:
Seth Hillbrand 2022-02-03 17:08:19 -08:00
parent 917845cf00
commit 3badd53a96
2 changed files with 5 additions and 1 deletions

View File

@ -923,6 +923,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 );

View File

@ -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 )