Fix all-layer snapping for footprint editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15538
This commit is contained in:
parent
d0f37ee55e
commit
467c672bcd
|
@ -53,6 +53,7 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
|
||||||
m_MagneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;
|
m_MagneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS;
|
||||||
m_MagneticItems.tracks = MAGNETIC_OPTIONS::NO_EFFECT;
|
m_MagneticItems.tracks = MAGNETIC_OPTIONS::NO_EFFECT;
|
||||||
m_MagneticItems.graphics = true;
|
m_MagneticItems.graphics = true;
|
||||||
|
m_MagneticItems.allLayers = false;
|
||||||
|
|
||||||
m_AuiPanels.appearance_panel_tab = 0;
|
m_AuiPanels.appearance_panel_tab = 0;
|
||||||
m_AuiPanels.right_panel_width = -1;
|
m_AuiPanels.right_panel_width = -1;
|
||||||
|
@ -95,6 +96,9 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
|
||||||
m_params.emplace_back( new PARAM<bool>( "editing.magnetic_graphics",
|
m_params.emplace_back( new PARAM<bool>( "editing.magnetic_graphics",
|
||||||
&m_MagneticItems.graphics, true ) );
|
&m_MagneticItems.graphics, true ) );
|
||||||
|
|
||||||
|
m_params.emplace_back( new PARAM<bool>( "editing.magnetic_all_layers",
|
||||||
|
&m_MagneticItems.allLayers, false ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<bool>( "editing.polar_coords",
|
m_params.emplace_back( new PARAM<bool>( "editing.polar_coords",
|
||||||
&m_PolarCoords, false ) );
|
&m_PolarCoords, false ) );
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
#include <footprint_edit_frame.h>
|
#include <footprint_edit_frame.h>
|
||||||
|
#include <footprint_editor_settings.h>
|
||||||
#include <widgets/wx_progress_reporters.h>
|
#include <widgets/wx_progress_reporters.h>
|
||||||
#include <widgets/wx_infobar.h>
|
#include <widgets/wx_infobar.h>
|
||||||
#include <wx/hyperlink.h>
|
#include <wx/hyperlink.h>
|
||||||
|
@ -1345,7 +1346,10 @@ int PCB_CONTROL::Redo( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
int PCB_CONTROL::SnapMode( const TOOL_EVENT& aEvent )
|
int PCB_CONTROL::SnapMode( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
bool& snapMode = m_frame->GetPcbNewSettings()->m_MagneticItems.allLayers;
|
MAGNETIC_SETTINGS& settings = m_isFootprintEditor
|
||||||
|
? m_frame->GetFootprintEditorSettings()->m_MagneticItems
|
||||||
|
: m_frame->GetPcbNewSettings()->m_MagneticItems;
|
||||||
|
bool& snapMode = settings.allLayers;
|
||||||
|
|
||||||
if( aEvent.IsAction( &PCB_ACTIONS::magneticSnapActiveLayer ) )
|
if( aEvent.IsAction( &PCB_ACTIONS::magneticSnapActiveLayer ) )
|
||||||
snapMode = false;
|
snapMode = false;
|
||||||
|
@ -1374,11 +1378,12 @@ int PCB_CONTROL::SnapModeFeedback( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
HOTKEY_CYCLE_POPUP* popup = m_frame->GetHotkeyPopup();
|
HOTKEY_CYCLE_POPUP* popup = m_frame->GetHotkeyPopup();
|
||||||
|
|
||||||
|
MAGNETIC_SETTINGS& settings = m_isFootprintEditor
|
||||||
|
? m_frame->GetFootprintEditorSettings()->m_MagneticItems
|
||||||
|
: m_frame->GetPcbNewSettings()->m_MagneticItems;
|
||||||
|
|
||||||
if( popup )
|
if( popup )
|
||||||
{
|
popup->Popup( _( "Object Snapping" ), labels, static_cast<int>( settings.allLayers ) );
|
||||||
popup->Popup( _( "Object Snapping" ), labels,
|
|
||||||
static_cast<int>( m_frame->GetPcbNewSettings()->m_MagneticItems.allLayers ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue