Pcbnew: fix incorrect size of solder paste rectangular area of rect pads.

When the solder paste margin was the same for X and Y directions, the margin
was not taken in account (missing code)

Fixes #6621
https://gitlab.com/kicad/code/kicad/issues/6621
This commit is contained in:
jean-pierre charras 2020-12-05 11:51:08 +01:00
parent 8781ce7efb
commit 63088e8bdb
1 changed files with 8 additions and 2 deletions

View File

@ -1025,9 +1025,15 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
{
const SHAPE_RECT* r = (SHAPE_RECT*) shape;
m_gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
// At this point, if margin.x < 0 the actual rectangle size is
// smaller than SHAPE_RECT r (the pad size was not modifed)
if( margin.x < 0 )
m_gal->DrawRectangle( r->GetPosition() - margin,
r->GetPosition() + r->GetSize() + margin );
else
m_gal->DrawRectangle( r->GetPosition(), r->GetPosition() + r->GetSize() );
if( margin.x > 0 )
if( margin.x > 0 ) // We draw a roudned rect shape
{
m_gal->DrawSegment( r->GetPosition(),
r->GetPosition() + VECTOR2I( r->GetWidth(), 0 ),