pcbnew: Swap all types of zones when swapping layers

This is a 5.0-only commit to implement correct layer swapping.

Fixes: lp:1789390
* https://bugs.launchpad.net/kicad/+bug/1789390
This commit is contained in:
Seth Hillbrand 2018-08-30 09:44:27 -07:00
parent fbd6654f9a
commit 25b6604fc5
1 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@
#include <class_board.h>
#include <class_track.h>
#include <class_zone.h>
#include <class_drawsegment.h>
#include <pcbnew.h>
@ -406,14 +407,14 @@ void PCB_EDIT_FRAME::Swap_Layers( wxCommandEvent& event )
}
}
// Change deprecated zones segments, only found in very old boards.
for( TRACK* segm = GetBoard()->m_SegZoneDeprecated; segm; segm = segm->Next() )
// Change zones
for( auto zone : GetBoard()->Zones() )
{
OnModify();
int jj = segm->GetLayer();
int jj = zone->GetLayer();
if( new_layer[jj] != NO_CHANGE )
segm->SetLayer( new_layer[jj] );
zone->SetLayer( new_layer[jj] );
}
// Change other segments.