From 63088e8bdbfe3ebdc7dea36a73a9fb3e2f13fda1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 5 Dec 2020 11:51:08 +0100 Subject: [PATCH] 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 --- pcbnew/pcb_painter.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index a20d063caf..6fb9c95841 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -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 ),