Commit ec1d2128 authored by Chris Pavlina's avatar Chris Pavlina Committed by Maciej Suminski
Browse files

bugfix: Avoid rendering component preview if either dimension is 0 (eeschema).

parent 6aff7466
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -346,6 +346,13 @@ void DIALOG_CHOOSE_COMPONENT::renderPreview( LIB_PART* aComponent, int aUnit )
    NEGATE( offset.x );
    NEGATE( offset.x );
    NEGATE( offset.y );
    NEGATE( offset.y );


    // Avoid rendering when either dimension is zero
    int width, height;

    dc.GetSize( &width, &height );
    if( !width || !height )
        return;

    aComponent->Draw( NULL, &dc, offset, aUnit, m_deMorganConvert, GR_COPY,
    aComponent->Draw( NULL, &dc, offset, aUnit, m_deMorganConvert, GR_COPY,
                      UNSPECIFIED_COLOR, DefaultTransform, true, true, false );
                      UNSPECIFIED_COLOR, DefaultTransform, true, true, false );
}
}