@ -247,6 +247,18 @@ PCB_PAINTER::PCB_PAINTER( GAL* aGal ) :
}
int PCB_PAINTER : : getLineThickness ( int aActualThickness ) const
{
// if items have 0 thickness, draw them with the outline
// width, otherwise respect the set value (which, no matter
// how small will produce something)
if ( aActualThickness = = 0 )
return m_pcbSettings . m_outlineWidth ;
return aActualThickness ;
}
bool PCB_PAINTER : : Draw ( const VIEW_ITEM * aItem , int aLayer )
{
const EDA_ITEM * item = static_cast < const EDA_ITEM * > ( aItem ) ;
@ -784,7 +796,7 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment, int aLayer )
if ( m_pcbSettings . m_sketchMode [ aLayer ] )
m_gal - > SetLineWidth ( m_pcbSettings . m_outlineWidth ) ; // Outline mode
else
m_gal - > SetLineWidth ( aSegment - > GetWidth ( ) ) ; // Filled mode
m_gal - > SetLineWidth ( getLineThickness ( aSegment - > GetWidth ( ) ) ) ; // Filled mode
switch ( aSegment - > GetShape ( ) )
{
@ -871,7 +883,7 @@ void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer )
else
{
// Filled mode
m_gal - > SetLineWidth ( aText - > GetThickness ( ) ) ;
m_gal - > SetLineWidth ( getLineThickness ( aText - > GetThickness ( ) ) ) ;
}
m_gal - > SetStrokeColor ( color ) ;
@ -899,7 +911,7 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
else
{
// Filled mode
m_gal - > SetLineWidth ( aText - > GetThickness ( ) ) ;
m_gal - > SetLineWidth ( getLineThickness ( aText - > GetThickness ( ) ) ) ;
}
m_gal - > SetStrokeColor ( color ) ;
@ -1021,7 +1033,7 @@ void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer )
m_gal - > SetStrokeColor ( strokeColor ) ;
m_gal - > SetIsFill ( false ) ;
m_gal - > SetIsStroke ( true ) ;
m_gal - > SetLineWidth ( aDimension - > GetWidth ( ) ) ;
m_gal - > SetLineWidth ( getLineThickness ( aDimension - > GetWidth ( ) ) ) ;
// Draw an arrow
m_gal - > DrawLine ( VECTOR2D ( aDimension - > m_crossBarO ) , VECTOR2D ( aDimension - > m_crossBarF ) ) ;
@ -1050,7 +1062,7 @@ void PCB_PAINTER::draw( const PCB_TARGET* aTarget )
VECTOR2D position ( aTarget - > GetPosition ( ) ) ;
double size , radius ;
m_gal - > SetLineWidth ( aTarget - > GetWidth ( ) ) ;
m_gal - > SetLineWidth ( getLineThickness ( aTarget - > GetWidth ( ) ) ) ;
m_gal - > SetStrokeColor ( strokeColor ) ;
m_gal - > SetIsFill ( false ) ;
m_gal - > SetIsStroke ( true ) ;