Re-arrange visibility flags only.

Colors are owned by the slot, not the layer objects.
This commit is contained in:
Jeff Young 2023-10-01 19:12:34 +01:00
parent 40ef850bd3
commit f58c0c370c
1 changed files with 2 additions and 9 deletions

View File

@ -546,21 +546,14 @@ void GERBVIEW_FRAME::SortLayersByX2Attributes()
void GERBVIEW_FRAME::RemapLayers( const std::unordered_map<int, int>& remapping )
{
std::unordered_map<int, COLOR4D> oldColors;
std::unordered_map<int, bool> oldVisibility;
LSET newVisibility;
for( const std::pair<const int, int>& entry : remapping )
{
oldColors[ entry.second ] = GetLayerColor( GERBER_DRAW_LAYER( entry.second ) );
oldVisibility[ entry.second ] = IsLayerVisible( entry.second );
}
for( const std::pair<const int, int>& entry : remapping )
{
SetLayerColor( GERBER_DRAW_LAYER( entry.first ), oldColors[ entry.second ] );
newVisibility.set( entry.first, oldVisibility[ entry.second ] );
}
std::unordered_map<int, int> view_remapping;