Fix incorrect calculation of pad bounding box

Fixes #4776
https://gitlab.com/kicad/code/kicad/issues/4776
This commit is contained in:
jean-pierre charras 2020-07-02 11:33:07 +02:00
parent f8bfb2bc16
commit af8f05d570
1 changed files with 12 additions and 2 deletions

View File

@ -338,9 +338,19 @@ void D_PAD::BuildEffectiveShapes() const
//
m_effectiveBoundingRadius = calcBoundingRadius();
bool first_shape = true;
for( const std::shared_ptr<SHAPE>& shape : m_effectiveShapes )
{
BOX2I r = shape->BBox();
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() ) ) );
}