From b05bf34b77c1408fd0cfe95858d5dafb9e36ca78 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 31 Jan 2021 14:54:48 -0500 Subject: [PATCH] Cleanup redundant if statement --- eeschema/lib_pin.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 59f7eb3cc5..41e4838e84 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -685,24 +685,21 @@ void LIB_PIN::PlotPinTexts( PLOTTER* aPlotter, wxPoint& aPinPos, int aPinOrient, { if( aDrawPinName ) { + EDA_TEXT_HJUSTIFY_T hjustify; if( aPinOrient == PIN_RIGHT ) { x = x1 + aTextInside; - aPlotter->Text( wxPoint( x, y1 ), nameColor, m_name, TEXT_ANGLE_HORIZ, - pinNameSize, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, - namePenWidth, false, false ); + hjustify = GR_TEXT_HJUSTIFY_LEFT; } else // orient == PIN_LEFT { x = x1 - aTextInside; - - if( aDrawPinName ) - { - aPlotter->Text( wxPoint( x, y1 ), nameColor, m_name, TEXT_ANGLE_HORIZ, - pinNameSize, GR_TEXT_HJUSTIFY_RIGHT, - GR_TEXT_VJUSTIFY_CENTER, namePenWidth, false, false ); - } + hjustify = GR_TEXT_HJUSTIFY_RIGHT; } + + aPlotter->Text( wxPoint( x, y1 ), nameColor, m_name, TEXT_ANGLE_HORIZ, pinNameSize, + hjustify, GR_TEXT_VJUSTIFY_CENTER, namePenWidth, + false, false ); } if( aDrawPinNum ) {