From ec1d2128bd97d2b1b7936b328ef7172b467a8a25 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Mon, 30 Mar 2015 17:23:31 +0200 Subject: [PATCH] bugfix: Avoid rendering component preview if either dimension is 0 (eeschema). --- eeschema/dialogs/dialog_choose_component.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eeschema/dialogs/dialog_choose_component.cpp b/eeschema/dialogs/dialog_choose_component.cpp index b16a7a9d08..21a73bde04 100644 --- a/eeschema/dialogs/dialog_choose_component.cpp +++ b/eeschema/dialogs/dialog_choose_component.cpp @@ -346,6 +346,13 @@ void DIALOG_CHOOSE_COMPONENT::renderPreview( LIB_PART* aComponent, int aUnit ) NEGATE( offset.x ); 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, UNSPECIFIED_COLOR, DefaultTransform, true, true, false ); }