Update position before first mouse-move-event.

Fixes: lp:1780426
* https://bugs.launchpad.net/kicad/+bug/1780426
This commit is contained in:
Jeff Young 2019-07-12 22:59:37 +01:00
parent 1dbaa89f95
commit 560fda70a2
1 changed files with 2 additions and 1 deletions

View File

@ -660,6 +660,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
{ {
module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) ); module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, module ); m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, module );
m_toolMgr->RunAction( ACTIONS::refreshPreview );
} }
else if( aEvent.HasPosition() ) else if( aEvent.HasPosition() )
m_toolMgr->RunAction( PCB_ACTIONS::cursorClick ); m_toolMgr->RunAction( PCB_ACTIONS::cursorClick );
@ -750,7 +751,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
m_menu.ShowContextMenu( selection() ); m_menu.ShowContextMenu( selection() );
} }
else if( module && evt->IsMotion() ) else if( module && ( evt->IsMotion() || evt->IsAction( &ACTIONS::refreshPreview ) ) )
{ {
module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) ); module->SetPosition( wxPoint( cursorPos.x, cursorPos.y ) );
selection().SetReferencePoint( cursorPos ); selection().SetReferencePoint( cursorPos );