Browse Source

Warp after context menu only if actively drawing.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/11080

(cherry picked from commit 1a7152d3eb)
newinvert
Jeff Young 2 years ago
committed by Roberto Fernandez Bautista
parent
commit
e7f18e7eab
  1. 15
      pcbnew/tools/drawing_tool.cpp
  2. 4
      pcbnew/tools/edit_tool_move_fct.cpp
  3. 3
      pcbnew/tools/pcb_selection_tool.cpp

15
pcbnew/tools/drawing_tool.cpp

@ -882,6 +882,9 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_RIGHT ) )
{
if( !text )
m_toolMgr->VetoContextMenuMouseWarp();
m_menu.ShowContextMenu( selection() );
}
else if( evt->IsClick( BUT_LEFT ) )
@ -1179,6 +1182,9 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_RIGHT ) )
{
if( !dimension )
m_toolMgr->VetoContextMenuMouseWarp();
m_menu.ShowContextMenu( selection() );
}
else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
@ -1976,6 +1982,9 @@ bool DRAWING_TOOL::drawShape( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic,
}
else if( evt->IsClick( BUT_RIGHT ) )
{
if( !graphic )
m_toolMgr->VetoContextMenuMouseWarp();
m_menu.ShowContextMenu( selection() );
}
else if( evt->IsClick( BUT_LEFT ) || evt->IsDblClick( BUT_LEFT ) )
@ -2411,6 +2420,9 @@ bool DRAWING_TOOL::drawArc( const TOOL_EVENT& aTool, PCB_SHAPE** aGraphic,
}
else if( evt->IsClick( BUT_RIGHT ) )
{
if( !graphic )
m_toolMgr->VetoContextMenuMouseWarp();
m_menu.ShowContextMenu( selection() );
}
else if( evt->IsAction( &PCB_ACTIONS::incWidth ) )
@ -2663,6 +2675,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
}
else if( evt->IsClick( BUT_RIGHT ) )
{
if( !started )
m_toolMgr->VetoContextMenuMouseWarp();
m_menu.ShowContextMenu( selection() );
}
// events that lock in nodes

4
pcbnew/tools/edit_tool_move_fct.cpp

@ -675,6 +675,10 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
restore_state = true; // Canceling the tool means that items have to be restored
break; // Finish
}
else if( evt->IsClick( BUT_RIGHT ) )
{
m_menu.ShowContextMenu( selection );
}
else if( evt->IsAction( &ACTIONS::undo ) || evt->IsAction( &ACTIONS::doDelete ) )
{
restore_state = true; // Perform undo locally

3
pcbnew/tools/pcb_selection_tool.cpp

@ -348,7 +348,10 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
m_frame->GetCanvas()->ForceRefresh();
if( !selectionCancelled )
{
m_toolMgr->VetoContextMenuMouseWarp();
m_menu.ShowContextMenu( m_selection );
}
}
else if( evt->IsDblClick( BUT_LEFT ) )
{

Loading…
Cancel
Save