Process via size inc/dec commands while running via tool.

Fixes: lp:1846320
* https://bugs.launchpad.net/kicad/+bug/1846320
This commit is contained in:
Jeff Young 2019-10-17 19:44:49 +01:00
parent 0995433601
commit e73e7bdc23
1 changed files with 15 additions and 3 deletions

View File

@ -181,10 +181,8 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
else if( newItem && evt->Category() == TC_COMMAND )
{
/*
* Handle any events that can affect the item as we move
* it around, eg rotate and flip
* Handle any events that can affect the item as we move it around
*/
if( TOOL_EVT_UTILS::IsRotateToolEvt( *evt ) && ( aOptions & IPO_ROTATE ) )
{
const int rotationAngle = TOOL_EVT_UTILS::GetEventRotationAngle( *frame(), *evt );
@ -196,6 +194,20 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
newItem->Flip( newItem->GetPosition(), frame()->Settings().m_FlipLeftRight );
view()->Update( &preview );
}
else if( evt->IsAction( &PCB_ACTIONS::viaSizeInc )
|| evt->IsAction( &PCB_ACTIONS::viaSizeDec ) )
{
// Refresh preview after event runs
m_toolMgr->RunAction( ACTIONS::refreshPreview );
}
else if( evt->IsAction( &ACTIONS::refreshPreview ) )
{
preview.Clear();
newItem.release();
makeNewItem( controls()->GetCursorPosition() );
view()->Update( &preview );
}
}
else if( newItem && evt->IsMotion() )