Include both text shapes and border shapes in textbox.
Fixes https://gitlab.com/kicad/code/kicad/issues/11806
This commit is contained in:
parent
66d6a5a9dd
commit
032708860b
|
@ -98,6 +98,25 @@ public:
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddShape( std::shared_ptr<SHAPE> aShape )
|
||||||
|
{
|
||||||
|
// Don't make clients deal with nested SHAPE_COMPOUNDs
|
||||||
|
if( aShape->HasIndexableSubshapes() )
|
||||||
|
{
|
||||||
|
std::vector<const SHAPE*> subshapes;
|
||||||
|
aShape->GetIndexableSubshapes( subshapes );
|
||||||
|
|
||||||
|
for( const SHAPE* subshape : subshapes )
|
||||||
|
m_shapes.push_back( subshape->Clone() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_shapes.push_back( aShape->Clone() );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
bool Empty() const
|
bool Empty() const
|
||||||
{
|
{
|
||||||
return m_shapes.empty();
|
return m_shapes.empty();
|
||||||
|
|
|
@ -435,7 +435,12 @@ wxString FP_TEXTBOX::GetShownText( int aDepth ) const
|
||||||
|
|
||||||
std::shared_ptr<SHAPE> FP_TEXTBOX::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
|
std::shared_ptr<SHAPE> FP_TEXTBOX::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
|
||||||
{
|
{
|
||||||
return GetEffectiveTextShape();
|
std::shared_ptr<SHAPE_COMPOUND> shape = GetEffectiveTextShape();
|
||||||
|
|
||||||
|
if( PCB_SHAPE::GetStroke().GetWidth() >= 0 )
|
||||||
|
shape->AddShape( PCB_SHAPE::GetEffectiveShape( aLayer, aFlash ) );
|
||||||
|
|
||||||
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -428,10 +428,12 @@ void PCB_TEXTBOX::SwapData( BOARD_ITEM* aImage )
|
||||||
|
|
||||||
std::shared_ptr<SHAPE> PCB_TEXTBOX::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
|
std::shared_ptr<SHAPE> PCB_TEXTBOX::GetEffectiveShape( PCB_LAYER_ID aLayer, FLASHING aFlash ) const
|
||||||
{
|
{
|
||||||
|
std::shared_ptr<SHAPE_COMPOUND> shape = GetEffectiveTextShape();
|
||||||
|
|
||||||
if( PCB_SHAPE::GetStroke().GetWidth() >= 0 )
|
if( PCB_SHAPE::GetStroke().GetWidth() >= 0 )
|
||||||
return PCB_SHAPE::GetEffectiveShape( aLayer, aFlash );
|
shape->AddShape( PCB_SHAPE::GetEffectiveShape( aLayer, aFlash ) );
|
||||||
else
|
|
||||||
return GetEffectiveTextShape();
|
return shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue