Remove repetitive calls to other cancel operations.

This commit is contained in:
Jeff Young 2018-11-19 15:54:36 +00:00
parent 5b9458f4c2
commit f71998b34e
5 changed files with 9 additions and 8 deletions

View File

@ -172,7 +172,7 @@ void LENGTH_TUNER_TOOL::performTuning()
while( OPT_TOOL_EVENT evt = Wait() )
{
if( evt->IsCancel() || evt->IsActivate() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
break;
else if( evt->IsMotion() )
{
@ -278,7 +278,7 @@ int LENGTH_TUNER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
// Main loop: keep receiving events
while( OPT_TOOL_EVENT evt = Wait() )
{
if( evt->IsCancel() || evt->IsActivate() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
{
break; // Finish
}

View File

@ -1040,9 +1040,10 @@ void ROUTER_TOOL::performDragging( int aMode )
if( m_router->FixRoute( m_endSnapPoint, m_endItem ) )
break;
}
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt )
|| evt->IsUndoRedo() )
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsUndoRedo() )
{
break;
}
handleCommonEvents( *evt );
}

View File

@ -1234,7 +1234,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr );
controls.ForceCursorPosition(true, cursorPos );
if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
{
break;
}

View File

@ -449,7 +449,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
if( reselect && module )
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, module );
if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
{
if( module )
{
@ -609,7 +609,7 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
{
cursorPos = controls->GetCursorPosition();
if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
break;
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )

View File

@ -79,7 +79,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
setControls();
}
else if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
{
if( m_cancelHandler )
{