Enable position-relative tool in footprint editor.
Fixes: lp:1778624 * https://bugs.launchpad.net/kicad/+bug/1778624 (cherry picked from commit 3ee9703)
This commit is contained in:
parent
5db4a85430
commit
da69a7cd9c
|
@ -920,6 +920,7 @@ void FOOTPRINT_EDIT_FRAME::setupTools()
|
||||||
m_toolManager->RegisterTool( new MODULE_EDITOR_TOOLS );
|
m_toolManager->RegisterTool( new MODULE_EDITOR_TOOLS );
|
||||||
m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL );
|
m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL );
|
||||||
m_toolManager->RegisterTool( new PICKER_TOOL );
|
m_toolManager->RegisterTool( new PICKER_TOOL );
|
||||||
|
m_toolManager->RegisterTool( new POSITION_RELATIVE_TOOL );
|
||||||
|
|
||||||
m_toolManager->GetTool<PAD_TOOL>()->SetEditModules( true );
|
m_toolManager->GetTool<PAD_TOOL>()->SetEditModules( true );
|
||||||
m_toolManager->GetTool<SELECTION_TOOL>()->SetEditModules( true );
|
m_toolManager->GetTool<SELECTION_TOOL>()->SetEditModules( true );
|
||||||
|
|
|
@ -86,7 +86,14 @@ bool POSITION_RELATIVE_TOOL::Init()
|
||||||
|
|
||||||
int POSITION_RELATIVE_TOOL::PositionRelative( const TOOL_EVENT& aEvent )
|
int POSITION_RELATIVE_TOOL::PositionRelative( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const auto& selection = m_selectionTool->RequestSelection( SanitizePadsEnsureEditableFilter );
|
PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
|
||||||
|
CLIENT_SELECTION_FILTER filter = SanitizePadsEnsureEditableFilter;
|
||||||
|
|
||||||
|
// Allow pad editing in Footprint Editor
|
||||||
|
if( editFrame->IsType( FRAME_PCB_MODULE_EDITOR ) )
|
||||||
|
filter = EnsureEditableFilter;
|
||||||
|
|
||||||
|
const auto& selection = m_selectionTool->RequestSelection( filter );
|
||||||
|
|
||||||
if( m_selectionTool->CheckLock() == SELECTION_LOCKED )
|
if( m_selectionTool->CheckLock() == SELECTION_LOCKED )
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -96,8 +103,6 @@ int POSITION_RELATIVE_TOOL::PositionRelative( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
m_position_relative_selection = selection;
|
m_position_relative_selection = selection;
|
||||||
|
|
||||||
PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
|
|
||||||
|
|
||||||
if( !m_position_relative_dialog )
|
if( !m_position_relative_dialog )
|
||||||
m_position_relative_dialog = new DIALOG_POSITION_RELATIVE( editFrame,
|
m_position_relative_dialog = new DIALOG_POSITION_RELATIVE( editFrame,
|
||||||
m_toolMgr,
|
m_toolMgr,
|
||||||
|
|
Loading…
Reference in New Issue