Treat internal copper layers as side-specific.

Fixes https://gitlab.com/kicad/code/kicad/issues/12726
This commit is contained in:
Jeff Young 2022-10-25 12:08:32 +01:00
parent d37526ba42
commit f480cbf93f
8 changed files with 13 additions and 13 deletions

View File

@ -905,9 +905,9 @@ LSET LSET::BackMask()
return saved;
}
LSET LSET::FrontBackMask()
LSET LSET::SideSpecificMask()
{
static const LSET saved = ( BackTechMask() | FrontTechMask() ).set( F_Cu ).set( B_Cu );
static const LSET saved = BackTechMask() | FrontTechMask() | AllCuMask();
return saved;
}

View File

@ -689,7 +689,7 @@ public:
*/
static LSET BackMask();
static LSET FrontBackMask();
static LSET SideSpecificMask();
static LSET UserMask();

View File

@ -150,7 +150,7 @@ void FP_TEXT::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
if( ( GetLayerSet() & LSET::FrontBackMask() ).any() )
if( ( GetLayerSet() & LSET::SideSpecificMask() ).any() )
SetMirrored( !IsMirrored() );
SetLocalCoord();

View File

@ -279,7 +279,7 @@ void FP_TEXTBOX::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
if( ( GetLayerSet() & LSET::FrontBackMask() ).any() )
if( ( GetLayerSet() & LSET::SideSpecificMask() ).any() )
SetMirrored( !IsMirrored() );
SetLocalCoord();

View File

@ -278,7 +278,7 @@ void PCB_DIMENSION_BASE::Mirror( const VECTOR2I& axis_pos, bool aMirrorLeftRight
INVERT( m_end.y );
}
if( ( GetLayerSet() & LSET::FrontBackMask() ).any() )
if( ( GetLayerSet() & LSET::SideSpecificMask() ).any() )
m_text.SetMirrored( !m_text.IsMirrored() );
Update();

View File

@ -1904,7 +1904,7 @@ void PCB_PAINTER::draw( const PCB_TEXT* aText, int aLayer )
else
attrs.m_StrokeWidth = getLineThickness( aText->GetEffectiveTextPenWidth() );
if( m_gal->IsFlippedX() && !( aText->GetLayerSet() & LSET::FrontBackMask() ).any() )
if( m_gal->IsFlippedX() && !( aText->GetLayerSet() & LSET::SideSpecificMask() ).any() )
{
attrs.m_Mirrored = !attrs.m_Mirrored;
attrs.m_Halign = static_cast<GR_TEXT_H_ALIGN_T>( -attrs.m_Halign );
@ -1994,7 +1994,7 @@ void PCB_PAINTER::draw( const PCB_TEXTBOX* aTextBox, int aLayer )
TEXT_ATTRIBUTES attrs = aTextBox->GetAttributes();
attrs.m_StrokeWidth = getLineThickness( aTextBox->GetEffectiveTextPenWidth() );
if( m_gal->IsFlippedX() && !( aTextBox->GetLayerSet() & LSET::FrontBackMask() ).any() )
if( m_gal->IsFlippedX() && !( aTextBox->GetLayerSet() & LSET::SideSpecificMask() ).any() )
{
attrs.m_Mirrored = !attrs.m_Mirrored;
attrs.m_Halign = static_cast<GR_TEXT_H_ALIGN_T>( -attrs.m_Halign );
@ -2081,7 +2081,7 @@ void PCB_PAINTER::draw( const FP_TEXT* aText, int aLayer )
else
attrs.m_StrokeWidth = getLineThickness( aText->GetEffectiveTextPenWidth() );
if( m_gal->IsFlippedX() && !( aText->GetLayerSet() & LSET::FrontBackMask() ).any() )
if( m_gal->IsFlippedX() && !( aText->GetLayerSet() & LSET::SideSpecificMask() ).any() )
{
attrs.m_Mirrored = !attrs.m_Mirrored;
attrs.m_Halign = static_cast<GR_TEXT_H_ALIGN_T>( -attrs.m_Halign );
@ -2155,7 +2155,7 @@ void PCB_PAINTER::draw( const FP_TEXTBOX* aTextBox, int aLayer )
attrs.m_Angle = aTextBox->GetDrawRotation();
attrs.m_StrokeWidth = getLineThickness( aTextBox->GetEffectiveTextPenWidth() );
if( m_gal->IsFlippedX() && !( aTextBox->GetLayerSet() & LSET::FrontBackMask() ).any() )
if( m_gal->IsFlippedX() && !( aTextBox->GetLayerSet() & LSET::SideSpecificMask() ).any() )
{
attrs.m_Mirrored = !attrs.m_Mirrored;
attrs.m_Halign = static_cast<GR_TEXT_H_ALIGN_T>( -attrs.m_Halign );
@ -2446,7 +2446,7 @@ void PCB_PAINTER::draw( const PCB_DIMENSION_BASE* aDimension, int aLayer )
wxString resolvedText = text.GetShownText();
TEXT_ATTRIBUTES attrs = text.GetAttributes();
if( m_gal->IsFlippedX() && !( aDimension->GetLayerSet() & LSET::FrontBackMask() ).any() )
if( m_gal->IsFlippedX() && !( aDimension->GetLayerSet() & LSET::SideSpecificMask() ).any() )
attrs.m_Mirrored = !attrs.m_Mirrored;
if( outline_mode )

View File

@ -247,7 +247,7 @@ void PCB_TEXT::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
if( ( GetLayerSet() & LSET::FrontBackMask() ).any() )
if( ( GetLayerSet() & LSET::SideSpecificMask() ).any() )
SetMirrored( !IsMirrored() );
}

View File

@ -384,7 +384,7 @@ void PCB_TEXTBOX::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
if( ( GetLayerSet() & LSET::FrontBackMask() ).any() )
if( ( GetLayerSet() & LSET::SideSpecificMask() ).any() )
SetMirrored( !IsMirrored() );
}