Browse Source

Pcbnew, EDIT_TOOL::GetAndPlace(): fix and issue, and allows execution only if

called inside the board editor.
Fix also a broken behavior: the current action was not cancelled, and if it is
called during a move items (when typing the 'T' key), items were broken.
The actual bug is the fact it is called also in fp editor and footprint wizard frame,
because it is part of EDIT_TOOL action list, common to fp editor, and should not.
But a full change is much more costly than just a filter.
6.0.7
jean-pierre charras 4 years ago
parent
commit
a5ff27cae7
  1. 5
      pcbnew/tools/edit_tool.cpp
  2. 2
      pcbnew/tools/pcb_actions.cpp

5
pcbnew/tools/edit_tool.cpp

@ -211,6 +211,11 @@ bool EDIT_TOOL::Init()
int EDIT_TOOL::GetAndPlace( const TOOL_EVENT& aEvent )
{
// GetAndPlace makes sense only in board editor, although it is also called
// in fpeditor, that shares the same EDIT_TOOL list
if( !getEditFrame<PCB_BASE_FRAME>()->IsType( FRAME_PCB_EDITOR ) )
return 0;
PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<PCB_SELECTION_TOOL>();
FOOTPRINT* fp = getEditFrame<PCB_BASE_FRAME>()->GetFootprintFromBoardByReference();

2
pcbnew/tools/pcb_actions.cpp

@ -245,7 +245,7 @@ TOOL_ACTION PCB_ACTIONS::getAndPlace( "pcbnew.InteractiveEdit.FindMove",
'T', LEGACY_HK_NAME( "Get and Move Footprint" ),
_( "Get and Move Footprint" ),
_( "Selects a footprint by reference designator and places it under the cursor for moving"),
BITMAPS::move );
BITMAPS::move, AF_ACTIVATE );
TOOL_ACTION PCB_ACTIONS::move( "pcbnew.InteractiveMove.move",
AS_GLOBAL,

Loading…
Cancel
Save