|
|
@ -4135,7 +4135,7 @@ void ALTIUM_PCB::ConvertTexts6ToBoardItemOnLayer( const ATEXT6& aElem, PCB_LAYER |
|
|
|
{ |
|
|
|
std::unique_ptr<PCB_TEXTBOX> pcbTextbox = std::make_unique<PCB_TEXTBOX>( m_board ); |
|
|
|
std::unique_ptr<PCB_TEXT> pcbText = std::make_unique<PCB_TEXT>( m_board ); |
|
|
|
bool isTextbox = ( aElem.textbox_rect_height != 0 ); |
|
|
|
bool isTextbox = aElem.isFrame; |
|
|
|
|
|
|
|
static const std::map<wxString, wxString> variableMap = { |
|
|
|
{ "LAYER_NAME", "LAYER" }, |
|
|
@ -4154,8 +4154,12 @@ void ALTIUM_PCB::ConvertTexts6ToBoardItemOnLayer( const ATEXT6& aElem, PCB_LAYER |
|
|
|
item = pcbTextbox.get(); |
|
|
|
text = pcbTextbox.get(); |
|
|
|
pcbTextbox->SetPosition( aElem.position - VECTOR2I( 0, aElem.textbox_rect_height ) ); |
|
|
|
pcbTextbox->SetRectangleHeight( aElem.textbox_rect_height ); |
|
|
|
pcbTextbox->SetRectangleWidth( aElem.textbox_rect_width ); |
|
|
|
pcbTextbox->SetRectangleHeight( aElem.textbox_rect_height + aElem.margin_border_width ); |
|
|
|
pcbTextbox->SetRectangleWidth( aElem.textbox_rect_width + aElem.margin_border_width ); |
|
|
|
pcbTextbox->SetMarginBottom( aElem.margin_border_width / 2 ); |
|
|
|
pcbTextbox->SetMarginLeft( aElem.margin_border_width / 2 ); |
|
|
|
pcbTextbox->SetMarginRight( aElem.margin_border_width / 2 ); |
|
|
|
pcbTextbox->SetMarginTop( aElem.margin_border_width / 2 ); |
|
|
|
|
|
|
|
switch( aElem.textbox_rect_justification ) |
|
|
|
{ |
|
|
@ -4222,7 +4226,7 @@ void ALTIUM_PCB::ConvertTexts6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, con |
|
|
|
EDA_TEXT* text = fpText.get(); |
|
|
|
PCB_FIELD* field = nullptr; |
|
|
|
|
|
|
|
bool isTextbox = ( aElem.textbox_rect_height != 0 ); |
|
|
|
bool isTextbox = aElem.isFrame; |
|
|
|
bool toAdd = false; |
|
|
|
|
|
|
|
if( aElem.isDesignator ) |
|
|
@ -4258,9 +4262,13 @@ void ALTIUM_PCB::ConvertTexts6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, con |
|
|
|
text = fpTextbox.get(); |
|
|
|
fpTextbox->SetPosition( aElem.position - VECTOR2I( 0, aElem.textbox_rect_height ) ); |
|
|
|
fpTextbox->SetStart( aElem.position - VECTOR2I( 0, aElem.textbox_rect_height ) ); |
|
|
|
fpTextbox->SetRectangleHeight( aElem.textbox_rect_height ); |
|
|
|
fpTextbox->SetRectangleWidth( aElem.textbox_rect_width ); |
|
|
|
fpTextbox->SetRectangleHeight( aElem.textbox_rect_height + aElem.margin_border_width ); |
|
|
|
fpTextbox->SetRectangleWidth( aElem.textbox_rect_width + aElem.margin_border_width ); |
|
|
|
fpTextbox->SetBorderEnabled( false ); |
|
|
|
fpTextbox->SetMarginBottom( aElem.margin_border_width / 2 ); |
|
|
|
fpTextbox->SetMarginLeft( aElem.margin_border_width / 2 ); |
|
|
|
fpTextbox->SetMarginRight( aElem.margin_border_width / 2 ); |
|
|
|
fpTextbox->SetMarginTop( aElem.margin_border_width / 2 ); |
|
|
|
|
|
|
|
// KiCad only does top? alignment for textboxes atm
|
|
|
|
switch( aElem.textbox_rect_justification ) |
|
|
@ -4301,6 +4309,42 @@ void ALTIUM_PCB::ConvertTexts6ToFootprintItemOnLayer( FOOTPRINT* aFootprint, con |
|
|
|
else |
|
|
|
{ |
|
|
|
text->SetTextPos( aElem.position ); |
|
|
|
|
|
|
|
switch( aElem.textbox_rect_justification ) |
|
|
|
{ |
|
|
|
case ALTIUM_TEXT_POSITION::LEFT_TOP: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_TOP ); |
|
|
|
break; |
|
|
|
case ALTIUM_TEXT_POSITION::LEFT_CENTER: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_TOP ); |
|
|
|
break; |
|
|
|
case ALTIUM_TEXT_POSITION::LEFT_BOTTOM: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM ); |
|
|
|
break; |
|
|
|
case ALTIUM_TEXT_POSITION::CENTER_TOP: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_TOP ); |
|
|
|
break; |
|
|
|
case ALTIUM_TEXT_POSITION::CENTER_BOTTOM: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_CENTER ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM ); |
|
|
|
break; |
|
|
|
case ALTIUM_TEXT_POSITION::RIGHT_TOP: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_TOP ); |
|
|
|
break; |
|
|
|
case ALTIUM_TEXT_POSITION::RIGHT_BOTTOM: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_RIGHT ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM ); |
|
|
|
break; |
|
|
|
default: |
|
|
|
text->SetHorizJustify( GR_TEXT_H_ALIGN_LEFT ); |
|
|
|
text->SetVertJustify( GR_TEXT_V_ALIGN_BOTTOM ); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|