Don't eat commands we don't need in move tool.

This also fixes the dynamic ratsnest issue.

Fixes https://gitlab.com/kicad/code/kicad/issues/5692
This commit is contained in:
Jeff Young 2020-09-18 13:11:34 +01:00
parent 1a988e8d85
commit 53297c78a6
1 changed files with 14 additions and 17 deletions

View File

@ -579,27 +579,24 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
}
// Dispatch TOOL_ACTIONs
else if( evt->Category() == TC_COMMAND )
else if( evt->IsAction( &ACTIONS::doDelete ) )
{
if( evt->IsAction( &ACTIONS::doDelete ) )
break; // finish -- there is no further processing for removed items
}
else if( evt->IsAction( &ACTIONS::duplicate ) )
{
break; // finish -- Duplicate tool will start a new Move with the dup'ed items
}
else if( evt->IsAction( &PCB_ACTIONS::moveExact ) )
{
// Reset positions so the Move Exactly is from the start.
for( EDA_ITEM* item : selection )
{
break; // finish -- there is no further processing for removed items
BOARD_ITEM* i = static_cast<BOARD_ITEM*>( item );
i->Move( -totalMovement );
}
else if( evt->IsAction( &ACTIONS::duplicate ) )
{
break; // finish -- Duplicate tool will start a new Move with the dup'ed items
}
else if( evt->IsAction( &PCB_ACTIONS::moveExact ) )
{
// Reset positions so the Move Exactly is from the start.
for( EDA_ITEM* item : selection )
{
BOARD_ITEM* i = static_cast<BOARD_ITEM*>( item );
i->Move( -totalMovement );
}
break; // finish -- we moved exactly, so we are finished
}
break; // finish -- we moved exactly, so we are finished
}
else if( evt->IsMouseUp( BUT_LEFT ) || evt->IsClick( BUT_LEFT ) )