Fixup IPC2581 knockout text

Fixes https://gitlab.com/kicad/code/kicad/-/issues/18042
This commit is contained in:
Seth Hillbrand 2024-05-26 08:03:38 -07:00
parent ab0426d620
commit becc0232b4
1 changed files with 3 additions and 6 deletions

View File

@ -600,18 +600,15 @@ void PCB_IO_IPC2581::addLineDesc( wxXmlNode* aNode, int aWidth, LINE_STYLE aDash
void PCB_IO_IPC2581::addKnockoutText( wxXmlNode* aContentNode, PCB_TEXT* aText ) void PCB_IO_IPC2581::addKnockoutText( wxXmlNode* aContentNode, PCB_TEXT* aText )
{ {
// If we are stroking a polygon, we need two contours. This is only allowed inside a wxXmlNode* text_node = appendNode( aContentNode, "UserStandard" );
// "UserSpecial" shape
wxXmlNode* special_node = appendNode( aContentNode, "UserSpecial" );
SHAPE_POLY_SET finalPoly; SHAPE_POLY_SET finalPoly;
aText->TransformTextToPolySet( finalPoly, 0, m_board->GetDesignSettings().m_MaxError, aText->TransformTextToPolySet( finalPoly, 0, m_board->GetDesignSettings().m_MaxError,
ERROR_INSIDE ); ERROR_INSIDE );
finalPoly.Fracture( SHAPE_POLY_SET::PM_FAST ); finalPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
for( int ii = 0; ii < finalPoly.OutlineCount(); ++ii ) addContourNode( text_node, finalPoly );
addContourNode( special_node, finalPoly, ii, FILL_T::FILLED_SHAPE, 0, LINE_STYLE::SOLID );
} }