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

This commit is contained in:
Chris Pavlina 2015-03-30 17:23:31 +02:00 committed by Maciej Suminski
parent 6aff74665a
commit ec1d2128bd
1 changed files with 7 additions and 0 deletions

View File

@ -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 );
} }