PCB_PAINTER: minor fix: display better pad shapes on solder paste layers.

the parameter margin percent was badly handled for rectangular/oval pads,
giving an incorrect solder paste shape for non 0.0 values
now it is is correctly handled.
This commit is contained in:
jean-pierre charras 2020-03-24 18:21:14 +01:00
parent 99a28fa3e5
commit eb250b4cb0
1 changed files with 12 additions and 6 deletions

View File

@ -845,27 +845,33 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
else
{
SHAPE_POLY_SET polySet;
wxSize margin;
int clearance = 0;
switch( aLayer )
{
case F_Mask:
case B_Mask:
clearance += aPad->GetSolderMaskMargin();
{
int clearance = aPad->GetSolderMaskMargin();
aPad->TransformShapeWithClearanceToPolygon( polySet, clearance );
}
break;
case F_Paste:
case B_Paste:
margin = aPad->GetSolderPasteMargin();
clearance += ( margin.x + margin.y ) / 2;
{
wxSize pad_size = aPad->GetSize();
wxSize margin = aPad->GetSolderPasteMargin();
const_cast<D_PAD*>(aPad)->SetSize( pad_size + margin );
aPad->TransformShapeWithClearanceToPolygon( polySet, 0 );
const_cast<D_PAD*>(aPad)->SetSize( pad_size );
}
break;
default:
aPad->TransformShapeWithClearanceToPolygon( polySet, 0 );
break;
}
aPad->TransformShapeWithClearanceToPolygon( polySet, clearance );
m_gal->DrawPolygon( polySet );
}