Browse Source

Remove repetitive calls to other cancel operations.

pull/13/head
Jeff Young 7 years ago
parent
commit
f71998b34e
  1. 4
      pcbnew/router/length_tuner_tool.cpp
  2. 5
      pcbnew/router/router_tool.cpp
  3. 2
      pcbnew/tools/edit_tool.cpp
  4. 4
      pcbnew/tools/pcb_editor_control.cpp
  5. 2
      pcbnew/tools/picker_tool.cpp

4
pcbnew/router/length_tuner_tool.cpp

@ -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
}

5
pcbnew/router/router_tool.cpp

@ -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 );
}

2
pcbnew/tools/edit_tool.cpp

@ -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;
}

4
pcbnew/tools/pcb_editor_control.cpp

@ -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 ) )

2
pcbnew/tools/picker_tool.cpp

@ -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 )
{

Loading…
Cancel
Save