From 4e8a35cb842a4fcbfb7d9fdc3c62f8e31d44f4d4 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 3 May 2017 16:20:46 -0400 Subject: [PATCH] Don't apply last line width to text thickness in symbol library editor. The symbol library header was setting the text thickness using the last line thickness setting which is incorrect so use the default thickness when creating new text objects. Fixes lp:1635344 https://bugs.launchpad.net/kicad/+bug/1635344 --- eeschema/symbdraw.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/eeschema/symbdraw.cpp b/eeschema/symbdraw.cpp index e2cdee0b26..10b81b8506 100644 --- a/eeschema/symbdraw.cpp +++ b/eeschema/symbdraw.cpp @@ -2,8 +2,8 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2006 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com - * Copyright (C) 2009-2011 Wayne Stambaugh - * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. + * Copyright (C) 2009-2017 Wayne Stambaugh + * Copyright (C) 2004-2017 KiCad Developers, see change_log.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -115,6 +115,7 @@ void LIB_EDIT_FRAME::EditGraphicSymbol( wxDC* DC, LIB_ITEM* DrawItem ) if( component ) component->GetDrawItemList().sort(); + OnModify( ); MSG_PANEL_ITEMS items; @@ -206,11 +207,17 @@ LIB_ITEM* LIB_EDIT_FRAME::CreateGraphicItem( LIB_PART* LibEntry, wxDC* DC ) if( m_drawItem ) { m_drawItem->BeginEdit( IS_NEW, drawPos ); - m_drawItem->SetWidth( m_drawLineWidth ); - m_drawItem->SetFillMode( m_drawFillStyle ); + + // Don't set line parameters for text objects. + if( m_drawItem->Type() != LIB_TEXT_T ) + { + m_drawItem->SetWidth( m_drawLineWidth ); + m_drawItem->SetFillMode( m_drawFillStyle ); + } if( m_drawSpecificUnit ) m_drawItem->SetUnit( m_unit ); + if( m_drawSpecificConvert ) m_drawItem->SetConvert( m_convert ); @@ -322,14 +329,14 @@ static void SymbolDisplayDraw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& return; item->SetEraseLastDrawItem( aErase ); - item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ), UNSPECIFIED_COLOR, g_XorMode, NULL, - DefaultTransform ); + item->Draw( aPanel, aDC, aPanel->GetParent()->GetCrossHairPosition( true ), UNSPECIFIED_COLOR, + g_XorMode, NULL, DefaultTransform ); } void LIB_EDIT_FRAME::EndDrawGraphicItem( wxDC* DC ) { - if( LIB_PART* part = GetCurPart() ) + if( LIB_PART* part = GetCurPart() ) { if( !m_drawItem ) return;