Fixes: lp:1639330 (Assertion failure opening libedit from eeschema in debug mode)

https://bugs.launchpad.net/kicad/+bug/1639330
This commit is contained in:
jean-pierre charras 2016-11-05 11:39:22 +01:00
parent c7fcb2695c
commit 3af551cef8
1 changed files with 10 additions and 4 deletions

View File

@ -1399,6 +1399,8 @@ void LIB_PIN::DrawPinElectricalTypeName( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode ) EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode )
{ {
wxString etypeName = GetElectricalTypeName(); wxString etypeName = GetElectricalTypeName();
// Use a reasonable (small) size to draw the text
int etextSize = (m_nameTextSize*3)/4; int etextSize = (m_nameTextSize*3)/4;
#define ETXT_MAX_SIZE Millimeter2iu(0.7 ) #define ETXT_MAX_SIZE Millimeter2iu(0.7 )
@ -1408,9 +1410,13 @@ void LIB_PIN::DrawPinElectricalTypeName( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
// Use a reasonable pen size to draw the text // Use a reasonable pen size to draw the text
int pensize = etextSize/6; int pensize = etextSize/6;
/* Get the num and name colors */ // Get a suitable color
if( (aColor < 0) && IsSelected() ) if( (aColor < 0) && IsSelected() )
aColor = GetItemSelectedColor(); aColor = GetItemSelectedColor();
else if( !IsVisible() )
aColor = GetInvisibleItemColor();
else
aColor = GetLayerColor( LAYER_NOTES );
wxPoint txtpos = aPosition; wxPoint txtpos = aPosition;
int offset = Millimeter2iu( 0.4 ); int offset = Millimeter2iu( 0.4 );