7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 14:59:50 +00:00

Put extension snaps behind an advanced config

This can be backed out when the snapping bevaviour is
considered good enough to be on by default.
This commit is contained in:
John Beard 2024-09-07 12:07:33 +01:00
parent b2be0d39bd
commit 6bad4bb1a2
3 changed files with 22 additions and 0 deletions

View File

@ -117,6 +117,7 @@ static const wxChar EnableAPILogging[] = wxT( "EnableAPILogging" );
static const wxChar MaxFileSystemWatchers[] = wxT( "MaxFileSystemWatchers" );
static const wxChar MinorSchematicGraphSize[] = wxT( "MinorSchematicGraphSize" );
static const wxChar ResolveTextRecursionDepth[] = wxT( "ResolveTextRecursionDepth" );
static const wxChar EnableExtensionSnaps[] = wxT( "EnableExtensionSnaps" );
} // namespace KEYS
@ -280,6 +281,8 @@ ADVANCED_CFG::ADVANCED_CFG()
m_ResolveTextRecursionDepth = 3;
m_EnableExtensionSnaps = false;
loadFromConfigFile();
}
@ -523,6 +526,10 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_ResolveTextRecursionDepth,
m_ResolveTextRecursionDepth, 0, 10 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableExtensionSnaps,
&m_EnableExtensionSnaps,
m_EnableExtensionSnaps ) );
// Special case for trace mask setting...we just grab them and set them immediately
// Because we even use wxLogTrace inside of advanced config
wxString traceMasks;

View File

@ -644,6 +644,14 @@ public:
*/
int m_ResolveTextRecursionDepth;
/**
* Enable snap anchors based on item line extensions.
*
* Setting name: "EnableExtensionSnaps"
* Default value: false
*/
bool m_EnableExtensionSnaps;
///@}
private:

View File

@ -27,6 +27,7 @@
#include <functional>
#include <advanced_config.h>
#include <pcb_dimension.h>
#include <pcb_shape.h>
#include <footprint.h>
@ -175,6 +176,12 @@ PCB_GRID_HELPER::~PCB_GRID_HELPER()
void PCB_GRID_HELPER::AddConstructionItems( std::vector<BOARD_ITEM*> aItems, bool aExtensionOnly,
bool aIsPersistent )
{
if( !ADVANCED_CFG::GetCfg().m_EnableExtensionSnaps )
{
return;
}
// For all the elements that get drawn construction geometry,
// add something suitable to the construction helper.
// This can be nothing.