Set selection reference point to top-left item.

Fixes: lp:1771016
* https://bugs.launchpad.net/kicad/+bug/1771016
This commit is contained in:
Jeff Young 2019-08-12 20:30:25 +01:00
parent e855b244ae
commit 3bf24fae7a
1 changed files with 9 additions and 3 deletions

View File

@ -767,10 +767,16 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector<BOARD_ITEM*>& aItems, bool aIsN
editTool->GetCurrentCommit()->Added( item ); editTool->GetCurrentCommit()->Added( item );
} }
selection.SetReferencePoint( VECTOR2I( 0, 0 ) ); if( selection.Size() > 0 )
{
BOARD_ITEM* item = (BOARD_ITEM*) selection.GetTopLeftItem();
m_toolMgr->ProcessEvent( EVENTS::SelectedEvent ); selection.SetReferencePoint( item->GetPosition() );
m_toolMgr->RunAction( PCB_ACTIONS::move, true ); getViewControls()->SetCursorPosition( getViewControls()->GetMousePosition(), false );
m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
m_toolMgr->RunAction( PCB_ACTIONS::move, true );
}
return 0; return 0;
} }