Browse Source

Code clarity.

7.0
Jeff Young 4 years ago
parent
commit
d0023add81
  1. 18
      common/eda_text.cpp
  2. 4
      include/eda_text.h

18
common/eda_text.cpp

@ -294,24 +294,24 @@ void EDA_TEXT::SwapAttributes( EDA_TEXT& aTradingPartner )
}
int EDA_TEXT::GetEffectiveTextPenWidth( int aDefaultWidth ) const
int EDA_TEXT::GetEffectiveTextPenWidth( int aDefaultPenWidth ) const
{
int width = GetTextThickness();
int penWidth = GetTextThickness();
if( width <= 1 )
if( penWidth <= 1 )
{
width = aDefaultWidth;
penWidth = aDefaultPenWidth;
if( IsBold() )
width = GetPenSizeForBold( GetTextWidth() );
else if( width <= 1 )
width = GetPenSizeForNormal( GetTextWidth() );
penWidth = GetPenSizeForBold( GetTextWidth() );
else if( penWidth <= 1 )
penWidth = GetPenSizeForNormal( GetTextWidth() );
}
// Clip pen size for small texts:
width = Clamp_Text_PenSize( width, GetTextSize(), ALLOW_BOLD_THICKNESS );
penWidth = Clamp_Text_PenSize( penWidth, GetTextSize(), ALLOW_BOLD_THICKNESS );
return width;
return penWidth;
}

4
include/eda_text.h

@ -120,9 +120,9 @@ public:
int GetTextThickness() const { return m_attributes.m_StrokeWidth; };
/**
* The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultWidth.
* The EffectiveTextPenWidth uses the text thickness if > 1 or aDefaultPenWidth.
*/
int GetEffectiveTextPenWidth( int aDefaultWidth = 0 ) const;
int GetEffectiveTextPenWidth( int aDefaultPenWidth = 0 ) const;
virtual void SetTextAngle( const EDA_ANGLE& aAngle );
const EDA_ANGLE& GetTextAngle() const { return m_attributes.m_Angle; }

Loading…
Cancel
Save