Show correct clearance lines for pads & vias not flashed on cur layer.
This commit is contained in:
parent
ba26e056ec
commit
8eb8d967d7
|
@ -716,11 +716,17 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer )
|
||||||
if( ( m_pcbSettings.m_clearance & clearanceFlags ) == clearanceFlags
|
if( ( m_pcbSettings.m_clearance & clearanceFlags ) == clearanceFlags
|
||||||
&& aLayer != LAYER_VIAS_HOLES )
|
&& aLayer != LAYER_VIAS_HOLES )
|
||||||
{
|
{
|
||||||
|
if( !aVia->FlashLayer( m_pcbSettings.GetActiveLayer() ) )
|
||||||
|
{
|
||||||
|
radius = getDrillSize(aVia) / 2.0 +
|
||||||
|
aVia->GetBoard()->GetDesignSettings().GetHolePlatingThickness();
|
||||||
|
}
|
||||||
|
|
||||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||||
m_gal->SetIsFill( false );
|
m_gal->SetIsFill( false );
|
||||||
m_gal->SetIsStroke( true );
|
m_gal->SetIsStroke( true );
|
||||||
m_gal->SetStrokeColor( color );
|
m_gal->SetStrokeColor( color );
|
||||||
m_gal->DrawCircle( center, radius + aVia->GetClearance( aVia->GetLayer() ) );
|
m_gal->DrawCircle( center, radius + aVia->GetClearance( m_pcbSettings.GetActiveLayer() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -902,7 +908,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::shared_ptr<SHAPE_COMPOUND> shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
|
auto shapes = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
|
||||||
|
|
||||||
if( shapes && shapes->Size() == 1 && shapes->Shapes()[0]->Type() == SH_SEGMENT )
|
if( shapes && shapes->Size() == 1 && shapes->Shapes()[0]->Type() == SH_SEGMENT )
|
||||||
{
|
{
|
||||||
|
@ -929,9 +935,11 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
||||||
constexpr int clearanceFlags = PCB_RENDER_SETTINGS::CL_PADS;
|
constexpr int clearanceFlags = PCB_RENDER_SETTINGS::CL_PADS;
|
||||||
|
|
||||||
if( ( m_pcbSettings.m_clearance & clearanceFlags ) == clearanceFlags
|
if( ( m_pcbSettings.m_clearance & clearanceFlags ) == clearanceFlags
|
||||||
&& ( aLayer == LAYER_PAD_FR
|
&& ( aLayer == LAYER_PAD_FR || aLayer == LAYER_PAD_BK || aLayer == LAYER_PADS_TH ) )
|
||||||
|| aLayer == LAYER_PAD_BK
|
{
|
||||||
|| aLayer == LAYER_PADS_TH ) )
|
bool flashLayer = aPad->FlashLayer( m_pcbSettings.GetActiveLayer() );
|
||||||
|
|
||||||
|
if( flashLayer || aPad->GetDrillSize().x )
|
||||||
{
|
{
|
||||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||||
m_gal->SetIsStroke( true );
|
m_gal->SetIsStroke( true );
|
||||||
|
@ -940,26 +948,40 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
||||||
|
|
||||||
int clearance = aPad->GetClearance( m_pcbSettings.GetActiveLayer() );
|
int clearance = aPad->GetClearance( m_pcbSettings.GetActiveLayer() );
|
||||||
|
|
||||||
const std::shared_ptr<SHAPE_COMPOUND> shapes =
|
if( flashLayer )
|
||||||
std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
|
{
|
||||||
|
auto shape = std::dynamic_pointer_cast<SHAPE_COMPOUND>( aPad->GetEffectiveShape() );
|
||||||
|
|
||||||
if( shapes && shapes->Size() == 1 && shapes->Shapes()[0]->Type() == SH_SEGMENT )
|
if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() == SH_SEGMENT )
|
||||||
{
|
{
|
||||||
const SHAPE_SEGMENT* seg = (SHAPE_SEGMENT*) shapes->Shapes()[0];
|
const SHAPE_SEGMENT* seg = (SHAPE_SEGMENT*) shape->Shapes()[0];
|
||||||
m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B, seg->GetWidth() + 2 * clearance );
|
m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B,
|
||||||
|
seg->GetWidth() + 2 * clearance );
|
||||||
}
|
}
|
||||||
else if( shapes && shapes->Size() == 1 && shapes->Shapes()[0]->Type() == SH_CIRCLE )
|
else if( shape && shape->Size() == 1 && shape->Shapes()[0]->Type() == SH_CIRCLE )
|
||||||
{
|
{
|
||||||
const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shapes->Shapes()[0];
|
const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape->Shapes()[0];
|
||||||
m_gal->DrawCircle( circle->GetCenter(), circle->GetRadius() + clearance );
|
m_gal->DrawCircle( circle->GetCenter(), circle->GetRadius() + clearance );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SHAPE_POLY_SET polySet;
|
SHAPE_POLY_SET polySet;
|
||||||
aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), clearance );
|
aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ),
|
||||||
|
clearance );
|
||||||
m_gal->DrawPolygon( polySet );
|
m_gal->DrawPolygon( polySet );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( aPad->GetEffectiveHoleShape() )
|
||||||
|
{
|
||||||
|
clearance += aPad->GetBoard()->GetDesignSettings().GetHolePlatingThickness();
|
||||||
|
|
||||||
|
const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
|
||||||
|
m_gal->DrawSegment( seg->GetSeg().A, seg->GetSeg().B,
|
||||||
|
seg->GetWidth() + 2 * clearance );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue