Don't make assumptions about what layers things are on.

This commit is contained in:
Jeff Young 2021-02-20 12:16:45 +00:00
parent a1f09befe0
commit ba63ac801a
5 changed files with 5 additions and 12 deletions

View File

@ -254,9 +254,7 @@ void DIMENSION_BASE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
{
Mirror( aCentre );
// DIMENSION items are not usually on copper layers, so
// copper layers count is not taken in accoun in Flip transform
SetLayer( FlipLayer( GetLayer() ) );
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
}

View File

@ -210,10 +210,7 @@ void FP_SHAPE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
break;
}
// PCB_SHAPE items are not usually on copper layers, but it can happen in microwave apps.
// However, currently, only on Front or Back layers.
// So the copper layers count is not taken in account
SetLayer( FlipLayer( GetLayer() ) );
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
}
bool FP_SHAPE::IsParentFlipped() const

View File

@ -149,7 +149,7 @@ void FP_TEXT::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
SetTextAngle( -GetTextAngle() );
SetLayer( FlipLayer( GetLayer() ) );
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
SetMirrored( IsBackLayer( GetLayer() ) );
SetLocalCoord();

View File

@ -308,9 +308,7 @@ void PCB_SHAPE::Flip( const wxPoint& aCentre, bool aFlipLeftRight )
break;
}
// PCB_SHAPE items are not allowed on copper layers, so
// copper layers count is not taken in account in Flip transform
SetLayer( FlipLayer( GetLayer() ) );
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
}

View File

@ -95,7 +95,7 @@ void PCB_TARGET::Flip(const wxPoint& aCentre, bool aFlipLeftRight )
else
m_pos.y = aCentre.y - ( m_pos.y - aCentre.y );
SetLayer( FlipLayer( GetLayer() ) );
SetLayer( FlipLayer( GetLayer(), GetBoard()->GetCopperLayerCount() ) );
}