GerbView: Fix DCode reordering; ensure loaded layers are visible

This commit is contained in:
Jon Evans
2018-02-28 08:23:41 +01:00
committed by jean-pierre charras
parent de483ac1aa
commit 2c54f6fe32
5 changed files with 30 additions and 27 deletions
+1 -14
View File
@@ -209,20 +209,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
break;
case ID_SORT_GBR_LAYERS:
auto remapping = GetImagesList()->SortImagesByZOrder();
myframe->ReFillLayerWidget();
myframe->syncLayerBox( true );
std::unordered_map<int, int> view_remapping;
for( auto it : remapping )
{
view_remapping[ GERBER_DRAW_LAYER( it.first) ] = GERBER_DRAW_LAYER( it.second );
}
myframe->GetGalCanvas()->GetView()->ReorderLayerData( view_remapping );
myframe->GetCanvas()->Refresh();
myframe->SortLayersByX2Attributes();
break;
}
}