Commit 0b545b63 authored by Marco Mattila's avatar Marco Mattila
Browse files

Fix freshly introduced footprint bounding box calculation bug.

parent b8c2e4dd
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -639,7 +639,7 @@ EDA_RECT MODULE::GetFootPrintRect() const
    area.Inflate( 500 );       // Give a min size
    area.Inflate( 500 );       // Give a min size


    for( EDGE_MODULE* edge = (EDGE_MODULE*) m_Drawings.GetFirst(); edge; edge = edge->Next() )
    for( EDGE_MODULE* edge = (EDGE_MODULE*) m_Drawings.GetFirst(); edge; edge = edge->Next() )
        if( edge->Type() == TYPE_TEXTE_MODULE )
        if( edge->Type() == TYPE_EDGE_MODULE )
            area.Merge( edge->GetBoundingBox() );
            area.Merge( edge->GetBoundingBox() );


    for( D_PAD* pad = m_Pads;  pad;  pad = pad->Next() )
    for( D_PAD* pad = m_Pads;  pad;  pad = pad->Next() )
@@ -653,14 +653,10 @@ EDA_RECT MODULE::GetBoundingBox() const
{
{
    EDA_RECT area = GetFootPrintRect();
    EDA_RECT area = GetFootPrintRect();


    // Calculate extended area including text field:
    // Calculate extended area including text fields
    area.Merge( m_Reference->GetBoundingBox() );
    area.Merge( m_Reference->GetBoundingBox() );
    area.Merge( m_Value->GetBoundingBox() );
    area.Merge( m_Value->GetBoundingBox() );


    for( EDGE_MODULE* edge = (EDGE_MODULE*) m_Drawings.GetFirst(); edge;  edge = edge->Next() )
        if( edge->Type() == TYPE_TEXTE_MODULE )
            area.Merge( edge->GetBoundingBox() );

    // Add the Clearance shape size: (shape around the pads when the
    // Add the Clearance shape size: (shape around the pads when the
    // clearance is shown.  Not optimized, but the draw cost is small
    // clearance is shown.  Not optimized, but the draw cost is small
    // (perhaps smaller than optimization).
    // (perhaps smaller than optimization).