Cherry-pick fix for pad clearances from master.

This commit is contained in:
Jeff Young 2022-07-25 21:50:23 +01:00
parent d9fef3da72
commit ac28ed9888
3 changed files with 31 additions and 0 deletions

View File

@ -741,6 +741,32 @@ int PAD::GetLocalClearance( wxString* aSource ) const
} }
int PAD::GetOwnClearance( PCB_LAYER_ID aLayer, wxString* aSource ) const
{
DRC_CONSTRAINT c;
if( GetBoard() && GetBoard()->GetDesignSettings().m_DRCEngine )
{
BOARD_DESIGN_SETTINGS& bds = GetBoard()->GetDesignSettings();
if( GetAttribute() == PAD_ATTRIB::NPTH )
c = bds.m_DRCEngine->EvalRules( HOLE_CLEARANCE_CONSTRAINT, this, nullptr, aLayer );
else
c = bds.m_DRCEngine->EvalRules( CLEARANCE_CONSTRAINT, this, nullptr, aLayer );
}
if( c.Value().HasMin() )
{
if( aSource )
*aSource = c.GetName();
return c.Value().Min();
}
return 0;
}
int PAD::GetSolderMaskMargin() const int PAD::GetSolderMaskMargin() const
{ {
// The pad inherits the margin only to calculate a default shape, // The pad inherits the margin only to calculate a default shape,

View File

@ -390,6 +390,8 @@ public:
int GetLocalClearance() const { return m_localClearance; } int GetLocalClearance() const { return m_localClearance; }
void SetLocalClearance( int aClearance ) { m_localClearance = aClearance; } void SetLocalClearance( int aClearance ) { m_localClearance = aClearance; }
int GetOwnClearance( PCB_LAYER_ID aLayer, wxString* aSource = nullptr ) const override;
int GetLocalSolderPasteMargin() const { return m_localSolderPasteMargin; } int GetLocalSolderPasteMargin() const { return m_localSolderPasteMargin; }
void SetLocalSolderPasteMargin( int aMargin ) { m_localSolderPasteMargin = aMargin; } void SetLocalSolderPasteMargin( int aMargin ) { m_localSolderPasteMargin = aMargin; }

View File

@ -1317,6 +1317,9 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
if( flashActiveLayer || aPad->GetDrillSize().x ) if( flashActiveLayer || aPad->GetDrillSize().x )
{ {
if( aPad->GetAttribute() == PAD_ATTRIB::NPTH )
color = m_pcbSettings.GetLayerColor( LAYER_NON_PLATEDHOLES );
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth ); m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
m_gal->SetIsStroke( true ); m_gal->SetIsStroke( true );
m_gal->SetIsFill( false ); m_gal->SetIsFill( false );