Added missing handler for 'activate' events in EDIT_TOOL

Fixes: lp:1660306
* https://bugs.launchpad.net/kicad/+bug/1660306
This commit is contained in:
Maciej Suminski 2017-01-30 14:05:26 +01:00
parent f0e0254e27
commit 9627f063ff
1 changed files with 13 additions and 13 deletions

View File

@ -171,19 +171,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
// Main loop: keep receiving events // Main loop: keep receiving events
do do
{ {
if( evt->IsCancel() ) if( evt->IsAction( &COMMON_ACTIONS::editActivate )
{
restore = true; // Cancelling the tool means that items have to be restored
break; // Finish
}
else if( evt->Action() == TA_UNDO_REDO_PRE )
{
unselect = true;
break;
}
else if( evt->IsAction( &COMMON_ACTIONS::editActivate )
|| evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) || evt->IsMotion() || evt->IsDrag( BUT_LEFT ) )
{ {
BOARD_ITEM* curr_item = selection.Front(); BOARD_ITEM* curr_item = selection.Front();
@ -253,6 +241,18 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true ); m_toolMgr->RunAction( COMMON_ACTIONS::editModifiedSelection, true );
} }
else if( evt->IsCancel() || evt->IsActivate() )
{
restore = true; // Cancelling the tool means that items have to be restored
break; // Finish
}
else if( evt->Action() == TA_UNDO_REDO_PRE )
{
unselect = true;
break;
}
// Dispatch TOOL_ACTIONs // Dispatch TOOL_ACTIONs
else if( evt->Category() == TC_COMMAND ) else if( evt->Category() == TC_COMMAND )
{ {