Remove repetitive calls to other cancel operations.
This commit is contained in:
parent
5b9458f4c2
commit
f71998b34e
|
@ -172,7 +172,7 @@ void LENGTH_TUNER_TOOL::performTuning()
|
||||||
|
|
||||||
while( OPT_TOOL_EVENT evt = Wait() )
|
while( OPT_TOOL_EVENT evt = Wait() )
|
||||||
{
|
{
|
||||||
if( evt->IsCancel() || evt->IsActivate() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
break;
|
break;
|
||||||
else if( evt->IsMotion() )
|
else if( evt->IsMotion() )
|
||||||
{
|
{
|
||||||
|
@ -278,7 +278,7 @@ int LENGTH_TUNER_TOOL::mainLoop( PNS::ROUTER_MODE aMode )
|
||||||
// Main loop: keep receiving events
|
// Main loop: keep receiving events
|
||||||
while( OPT_TOOL_EVENT evt = Wait() )
|
while( OPT_TOOL_EVENT evt = Wait() )
|
||||||
{
|
{
|
||||||
if( evt->IsCancel() || evt->IsActivate() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
{
|
{
|
||||||
break; // Finish
|
break; // Finish
|
||||||
}
|
}
|
||||||
|
|
|
@ -1040,9 +1040,10 @@ void ROUTER_TOOL::performDragging( int aMode )
|
||||||
if( m_router->FixRoute( m_endSnapPoint, m_endItem ) )
|
if( m_router->FixRoute( m_endSnapPoint, m_endItem ) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt )
|
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsUndoRedo() )
|
||||||
|| evt->IsUndoRedo() )
|
{
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
handleCommonEvents( *evt );
|
handleCommonEvents( *evt );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1234,7 +1234,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
||||||
const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr );
|
const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr );
|
||||||
controls.ForceCursorPosition(true, cursorPos );
|
controls.ForceCursorPosition(true, cursorPos );
|
||||||
|
|
||||||
if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
|
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -449,7 +449,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
|
||||||
if( reselect && module )
|
if( reselect && module )
|
||||||
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, 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 )
|
if( module )
|
||||||
{
|
{
|
||||||
|
@ -609,7 +609,7 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
cursorPos = controls->GetCursorPosition();
|
cursorPos = controls->GetCursorPosition();
|
||||||
|
|
||||||
if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
|
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
|
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
|
||||||
|
|
|
@ -79,7 +79,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
setControls();
|
setControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() )
|
else if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||||
{
|
{
|
||||||
if( m_cancelHandler )
|
if( m_cancelHandler )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue