Fix other stroke types still drawing the border regardless of enable

This commit is contained in:
Marek Roszko 2023-08-31 07:52:19 -04:00
parent 21c54f9721
commit 37717a8281
1 changed files with 22 additions and 19 deletions

View File

@ -2149,31 +2149,34 @@ void PCB_PAINTER::draw( const PCB_TEXTBOX* aTextBox, int aLayer )
m_gal->SetIsFill( true ); m_gal->SetIsFill( true );
m_gal->SetIsStroke( false ); m_gal->SetIsStroke( false );
if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE ) if( aTextBox->IsBorderEnabled() )
{ {
if( aTextBox->IsBorderEnabled() && thickness > 0 ) if( lineStyle <= PLOT_DASH_TYPE::FIRST_TYPE )
{ {
std::vector<VECTOR2I> pts = aTextBox->GetCorners(); if( thickness > 0 )
{
std::vector<VECTOR2I> pts = aTextBox->GetCorners();
for( size_t ii = 0; ii < pts.size(); ++ii ) for( size_t ii = 0; ii < pts.size(); ++ii )
m_gal->DrawSegment( pts[ ii ], pts[ (ii + 1) % pts.size() ], thickness ); m_gal->DrawSegment( pts[ii], pts[( ii + 1 ) % pts.size()], thickness );
}
} }
} else
else
{
std::vector<SHAPE*> shapes = aTextBox->MakeEffectiveShapes( true );
for( SHAPE* shape : shapes )
{ {
STROKE_PARAMS::Stroke( shape, lineStyle, thickness, &m_pcbSettings, std::vector<SHAPE*> shapes = aTextBox->MakeEffectiveShapes( true );
[&]( const VECTOR2I& a, const VECTOR2I& b )
{
m_gal->DrawSegment( a, b, thickness );
} );
}
for( SHAPE* shape : shapes ) for( SHAPE* shape : shapes )
delete shape; {
STROKE_PARAMS::Stroke( shape, lineStyle, thickness, &m_pcbSettings,
[&]( const VECTOR2I& a, const VECTOR2I& b )
{
m_gal->DrawSegment( a, b, thickness );
} );
}
for( SHAPE* shape : shapes )
delete shape;
}
} }
if( resolvedText.Length() == 0 ) if( resolvedText.Length() == 0 )