diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index c025c02039..96c40b45e9 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -338,11 +338,21 @@ void D_PAD::BuildEffectiveShapes() const // m_effectiveBoundingRadius = calcBoundingRadius(); + bool first_shape = true; + for( const std::shared_ptr& shape : m_effectiveShapes ) { BOX2I r = shape->BBox(); - m_effectiveBoundingBox.Merge( EDA_RECT( (wxPoint) r.GetOrigin(), - wxSize( r.GetWidth(), r.GetHeight() ) ) ); + + if( first_shape ) + { + m_effectiveBoundingBox.SetOrigin( (wxPoint) r.GetOrigin() ); + m_effectiveBoundingBox.SetEnd( (wxPoint) r.GetEnd() ); + first_shape = false; + } + else + m_effectiveBoundingBox.Merge( EDA_RECT( (wxPoint) r.GetOrigin(), + wxSize( r.GetWidth(), r.GetHeight() ) ) ); } // Hole shape