Restore fill polygons on proper layers when flipping zones.

(cherry picked from commit 0ea85ec9f5)
This commit is contained in:
Alex Shvartzkop 2023-10-12 02:21:47 +03:00
parent f1c570d793
commit 9159f5a004
1 changed files with 13 additions and 0 deletions

View File

@ -705,7 +705,20 @@ void ZONE::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
{
Mirror( aCentre, aFlipLeftRight );
std::map<PCB_LAYER_ID, SHAPE_POLY_SET> fillsCopy;
for( auto& [oldLayer, shapePtr] : m_FilledPolysList )
{
fillsCopy[oldLayer] = *shapePtr;
}
SetLayerSet( FlipLayerMask( GetLayerSet(), GetBoard()->GetCopperLayerCount() ) );
for( auto& [oldLayer, shape] : fillsCopy )
{
PCB_LAYER_ID newLayer = FlipLayer( oldLayer, GetBoard()->GetCopperLayerCount() );
SetFilledPolysList( newLayer, shape );
}
}